• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cormas / ecec-model / 5666094719

pending completion
5666094719

push

github

olekscode
Added defaultInit method to the class side

4 of 4 new or added lines in 1 file covered. (100.0%)

13 of 308 relevant lines covered (4.22%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/ECEC-Model/ECECModel.class.st
1
Class {
2
        #name : #ECECModel,
3
        #superclass : #CMAbstractModel,
4
        #instVars : [
5
                'theRestrainedForagers',
6
                'theUnrestrainedForagers',
7
                'theVegetationUnits'
8
        ],
9
        #category : #'ECEC-Model'
10
}
11

12
{ #category : #'simulation settings' }
13
ECECModel class >> defaultInit [
×
14

×
15
        ^ #homogeneousEnvironment
×
16
]
×
17

18
{ #category : #accessing }
19
ECECModel class >> initialNumberOfRestrainedForagers [
×
20

×
21
        ^ 10
×
22
]
×
23

24
{ #category : #accessing }
25
ECECModel class >> initialNumberOfUnrestrainedForagers [
×
26

×
27
        ^ 10
×
28
]
×
29

30
{ #category : #init }
31
ECECModel >> homogeneousEnvironment [
×
32

×
33
        self
×
34
                createGridLines: 27
×
35
                columns: 27
×
36
                neighbourhood: 8
×
37
                closed: false.
×
38
                
×
39
        self theVegetationUnits do: [ :each | each initializeWithRandomBiomass ].
×
40
        
×
41
        self
×
42
                initializeAgents;
×
43
                displayPov: #povBiomass of: ECECVegetationUnit;
×
44
                displayPov: #defaultPOV of: ECECForager
×
45
]
×
46

47
{ #category : #initialization }
48
ECECModel >> initialize [
×
49

×
50
        super initialize.
×
51
        
×
52
        theRestrainedForagers := OrderedCollection new.
×
53
        theUnrestrainedForagers := OrderedCollection new.
×
54
        theVegetationUnits := OrderedCollection new.
×
55
]
×
56

57
{ #category : #'init entities' }
58
ECECModel >> initializeAgents [
×
59

×
60
        self
×
61
                createN: self class initialNumberOfRestrainedForagers
×
62
                randomlyLocatedAloneEntities: ECECRestrainedForager.
×
63
                
×
64
        self
×
65
                createN: self class initialNumberOfUnrestrainedForagers
×
66
                randomlyLocatedAloneEntities: ECECUnrestrainedForager.
×
67
]
×
68

69
{ #category : #probes }
70
ECECModel >> numberOfRestrainedForagers [
×
71

×
72
        <probe>
×
73
        ^ self theRestrainedForagers size
×
74
]
×
75

76
{ #category : #probes }
77
ECECModel >> numberOfUnrestrainedForagers [
×
78

×
79
        <probe>
×
80
        ^ self theUnrestrainedForagers size
×
81
]
×
82

83
{ #category : #control }
84
ECECModel >> step: anObject [
×
85

×
86
        self
×
87
                stepEntities: self theVegetationUnits;
×
88
                askRandom: ECECForager toDo: #step
×
89
]
×
90

91
{ #category : #accessing }
92
ECECModel >> theRestrainedForagers [
×
93

×
94
        ^ theRestrainedForagers
×
95
]
×
96

97
{ #category : #accessing }
98
ECECModel >> theRestrainedForagers: anObject [
×
99

×
100
        theRestrainedForagers := anObject
×
101
]
×
102

103
{ #category : #accessing }
104
ECECModel >> theUnrestrainedForagers [
×
105

×
106
        ^ theUnrestrainedForagers
×
107
]
×
108

109
{ #category : #accessing }
110
ECECModel >> theUnrestrainedForagers: anObject [
×
111

×
112
        theUnrestrainedForagers := anObject
×
113
]
×
114

115
{ #category : #accessing }
116
ECECModel >> theVegetationUnits [
×
117

×
118
        ^ theVegetationUnits
×
119
]
×
120

121
{ #category : #accessing }
122
ECECModel >> theVegetationUnits: anObject [
×
123

×
124
        theVegetationUnits := anObject
×
125
]
×
126

127
{ #category : #probes }
128
ECECModel >> totalAmountOfBiomass [
×
129

×
130
        <probe>
×
131
        ^ self theVegetationUnits sum: [ :each | each biomass ]
×
132
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc