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

cormas / ecec-model / 6198969123

15 Sep 2023 01:58PM UTC coverage: 3.641%. Remained the same
6198969123

push

github

olekscode
Fixed the deprecated method call

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

13 of 357 relevant lines covered (3.64%)

0.11 hits per line

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

0.0
/src/ECEC-Model/ECECVegetationUnit.class.st
1
Class {
2
        #name : #ECECVegetationUnit,
3
        #superclass : #CMSpatialEntityElement,
4
        #instVars : [
5
                'biomass'
6
        ],
7
        #category : #'ECEC-Model'
8
}
9

10
{ #category : #accessing }
11
ECECVegetationUnit class >> entityName [
×
12

×
13
        ^ 'VegetationUnit'
×
14
]
×
15

16
{ #category : #accessing }
17
ECECVegetationUnit class >> k [
×
18

×
19
        ^ 10 
×
20
]
×
21

22
{ #category : #accessing }
23
ECECVegetationUnit class >> r [
×
24

×
25
        ^ 0.2 
×
26
]
×
27

28
{ #category : #converting }
29
ECECVegetationUnit >> asString [
×
30
        " Private - See superimplementor's comment "
×
31

×
32
         ^ String streamContents: [ : stream | 
×
33
                   stream
×
34
                           << super asString;
×
35
                                 crtab; tab;
×
36
                                  << 'biomass: ';
×
37
                                 << (biomass truncateTo: 0.005) asString ]
×
38
]
×
39

40
{ #category : #accessing }
41
ECECVegetationUnit >> biomass [
×
42

×
43
        ^ biomass
×
44
]
×
45

46
{ #category : #accessing }
47
ECECVegetationUnit >> biomass: anObject [
×
48

×
49
        biomass := anObject
×
50
]
×
51

52
{ #category : #initialization }
53
ECECVegetationUnit >> initialize [ 
×
54

×
55
        super initialize.
×
56
        biomass := 0.
×
57
]
×
58

59
{ #category : #initialization }
60
ECECVegetationUnit >> initializeWithRandomBiomass [
×
61

×
62
        self biomass: Cormas random
×
63
]
×
64

65
{ #category : #printing }
66
ECECVegetationUnit >> interestingDetails [
×
67
        "Answer a <Collection> of interesting receiver's attributes, from a modeler point of view, to display in a popup for example"
×
68

×
69
        ^ super interestingDetails , { 
×
70
                'Biomass' -> ((biomass truncateTo: 0.005) asString)
×
71
                }
×
72
]
×
73

74
{ #category : #growth }
75
ECECVegetationUnit >> logisticGrowth [
×
76

×
77
        self biomass: (Cormas logisticGrowth: self biomass r: self class r K: self class k)
×
78
]
×
79

80
{ #category : #pov }
81
ECECVegetationUnit >> povBiomass [
×
82

×
83
        ^ self
×
84
                povAttribute: #biomass
×
85
                min: 0
×
86
                max: self class k
×
87
                color: Color green
×
88
]
×
89

90
{ #category : #pov }
91
ECECVegetationUnit >> povBiomassForager [
×
92
        
×
93
        ^ self biomass < ECECForager catabolicRate
×
94
                ifTrue: [ Color white ]
×
95
                ifFalse: [ self povBiomass ]
×
96
]
×
97

98
{ #category : #pov }
99
ECECVegetationUnit >> povForagersVision [
×
100

×
101
        (self hasOccupantsOfClass: ECECForager)
×
102
                ifTrue: [ ^ self povBiomassForager ].
×
103
        
×
104
        (self neighbourhood anySatisfy: [ :each | each hasOccupantsOfClass: ECECForager ])
×
105
                ifTrue: [ ^ self povBiomassForager ].
×
106
        
×
107
        ^ Color black
×
108
]
×
109

110
{ #category : #stepping }
111
ECECVegetationUnit >> step [
×
112
        
×
113
        self logisticGrowth
×
114
]
×
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