Adding seasons

This commit is contained in:
EEva 2013-07-17 16:10:47 +02:00
parent 1c2d6106e4
commit 31265af4fb
5 changed files with 94 additions and 19 deletions

View File

@ -26,14 +26,33 @@ to-report honey-quant [ ha hi ]
end
to-report harv-index [ hi ]
if hi = "PF" [ report 0.000004 ] ; Polyflower
if hi = "AC" [ report 0.0000135 ] ; Accacia
if hi = "LM" [ report 0.000018 ] ; Lime
if hi = "SF" [ report 0.000006 ] ; Sunflower
if hi = "AC" and acacia-season [ report 0.0000135 ] ; Acacia
if hi = "LM" and lime-season [ report 0.000018 ] ; Lime
if hi = "SF" and sunflower-season [ report 0.000006 ] ; Sunflower
report 0.000004 ; Polyflower
; the following shouldn't happen
error 1
end
to-report acacia-season
if ticks > 30 + abegin-uncertainty and ticks < 61 + aend-uncertainty
[ report true ]
report false
end
to-report lime-season
if ticks > 61 + lbegin-uncertainty and ticks < 91 + lend-uncertainty
[ report true ]
report false
end
to-report sunflower-season
if ticks > 91 + sbegin-uncertainty and ticks < 122 + send-uncertainty
[ report true ]
report false
end
to-report uncertainty
report random-normal 1.0 harvesting-uncertainty
end
@ -44,10 +63,12 @@ to-report bees-quant [ hive-age ]
[ report 500 * hive-age + 65000 ]
end
to-report color-flower [ hi ]
if hi = "PF" [ report VIOLET ] ; Polyflower
if hi = "AC" [ report RED ] ; Accacia
if hi = "LM" [ report GREEN ] ; Lime
if hi = "LM" [ report LIME ] ; Lime
if hi = "SF" [ report YELLOW ] ; Sunflower
; the following shouldn't happen
error 1

View File

@ -2,7 +2,13 @@ extensions [ gis ]
globals [
romanian-county-borders-dataset
county-names ]
county-names
abegin-uncertainty
aend-uncertainty
sbegin-uncertainty
send-uncertainty
lbegin-uncertainty
lend-uncertainty ]
__includes [
"setup-gis.nls"
@ -22,6 +28,7 @@ to setup
setup-gis
setup-spots
setup-beekeepers
setup-seasons-uncertainty
end
@ -37,14 +44,15 @@ to go
; collect honey and make money
if ticks > 153 [ stop ]
tick
end
@#$#@#$#@
GRAPHICS-WINDOW
317
307
10
1331
1321
545
-1
-1
@ -109,17 +117,17 @@ harvesting-uncertainty
harvesting-uncertainty
0
10
1
3.9
0.1
1
NIL
VERTICAL
SLIDER
135
49
168
244
177
50
210
245
travel-cost
travel-cost
0
@ -193,8 +201,8 @@ NIL
PLOT
12
573
505
885
359
768
Emplacements
NIL
NIL
@ -206,11 +214,47 @@ true
true
"" ""
PENS
"Accacia" 1.0 0 -2674135 true "" "plot count beekeepers-on spots with [ flower-type = \"AC\" ]"
"Sunflower" 1.0 0 -1184463 true "" "plot count beekeepers-on spots with [ flower-type = \"SF\" ]"
"Lime" 1.0 0 -10899396 true "" "plot count beekeepers-on spots with [ flower-type = \"LM\" ]"
"Accacia" 1.0 0 -2674135 true "" "plot count beekeepers-on spots with [ flower-type = \"AC\" and acacia-season ]"
"Sunflower" 1.0 0 -1184463 true "" "plot count beekeepers-on spots with [ flower-type = \"SF\" and sunflower-season ]"
"Lime" 1.0 0 -13840069 true "" "plot count beekeepers-on spots with [ flower-type = \"LM\" and lime-season ]"
"Polyflower" 1.0 0 -8630108 true "" "plot count beekeepers-on spots with [ flower-type = \"PF\" ]"
PLOT
364
574
691
768
Flower season
NIL
NIL
0.0
10.0
0.0
2.0E-5
true
true
"" ""
PENS
"Polyflower" 1.0 0 -8630108 true "" "plot harv-index \"PL\""
"Sunflower" 1.0 0 -1184463 true "" "plot harv-index \"SF\""
"Lime" 1.0 0 -13840069 true "" "plot harv-index \"LM\""
"Acacia" 1.0 0 -2674135 true "" "plot harv-index \"AC\""
SLIDER
133
50
171
247
season-uncertainty
season-uncertainty
0
20
20
0.1
1
NIL
VERTICAL
@#$#@#$#@
## WHAT IS IT?

View File

@ -2,7 +2,7 @@
;; GIS maps (shp files) are taken from:
;; - http://download.geofabrik.de/europe/romania.html
;; - http://www.gadm.org/download
;; and then filtered to only keep relevant information
;; and then filtered to only keep relevant information (using qgis / arcgis)
to setup-gis

View File

@ -1,3 +1,4 @@
to-report with-strategy-maximize-profit
;; to explode. beekeeper do not know in advance
report max-one-of spots with [ not any? beekeepers-on self] [ beekeep-utility 5 flower-type (distance myself) ]
end

View File

@ -21,4 +21,13 @@ to setup-beekeepers
set size 1
move-to one-of centroids
if trace-on [ set color red pd ] ]
end
to setup-seasons-uncertainty
set abegin-uncertainty random-normal 0 season-uncertainty
set aend-uncertainty random-normal 0 season-uncertainty
set sbegin-uncertainty random-normal 0 season-uncertainty
set send-uncertainty random-normal 0 season-uncertainty
set lbegin-uncertainty random-normal 0 season-uncertainty
set lend-uncertainty random-normal 0 season-uncertainty
end