Adding yearly seasons

This commit is contained in:
EEva 2013-07-17 17:17:09 +02:00
parent 31265af4fb
commit f65708f28e
3 changed files with 40 additions and 12 deletions

View File

@ -26,29 +26,37 @@ to-report honey-quant [ ha hi ]
end end
to-report harv-index [ hi ] to-report harv-index [ hi ]
if hi = "AC" and acacia-season [ report 0.0000135 ] ; Acacia ifelse flower-season
if hi = "LM" and lime-season [ report 0.000018 ] ; Lime [ if hi = "AC" and acacia-season [ report 0.0000135 ] ; Acacia
if hi = "SF" and sunflower-season [ report 0.000006 ] ; Sunflower if hi = "LM" and lime-season [ report 0.000018 ] ; Lime
if hi = "SF" and sunflower-season [ report 0.000006 ] ; Sunflower
report 0.000004 ; Polyflower report 0.000004 ; Polyflower
]
[ report 0.0 ]
; the following shouldn't happen ; the following shouldn't happen
error 1 error 1
end end
to-report acacia-season to-report acacia-season
if ticks > 30 + abegin-uncertainty and ticks < 61 + aend-uncertainty if yearly-ticks > 119 + abegin-uncertainty and yearly-ticks < 150 + aend-uncertainty
[ report true ] [ report true ]
report false report false
end end
to-report lime-season to-report lime-season
if ticks > 61 + lbegin-uncertainty and ticks < 91 + lend-uncertainty if yearly-ticks > 150 + lbegin-uncertainty and yearly-ticks < 180 + lend-uncertainty
[ report true ] [ report true ]
report false report false
end end
to-report sunflower-season to-report sunflower-season
if ticks > 91 + sbegin-uncertainty and ticks < 122 + send-uncertainty if yearly-ticks > 180 + sbegin-uncertainty and yearly-ticks < 211 + send-uncertainty
[ report true ]
report false
end
to-report flower-season
if yearly-ticks > 89 and yearly-ticks < 241
[ report true ] [ report true ]
report false report false
end end

View File

@ -3,6 +3,7 @@ extensions [ gis ]
globals [ globals [
romanian-county-borders-dataset romanian-county-borders-dataset
county-names county-names
yearly-ticks
abegin-uncertainty abegin-uncertainty
aend-uncertainty aend-uncertainty
sbegin-uncertainty sbegin-uncertainty
@ -40,13 +41,17 @@ to go
; move to a better spot (with different strategies) ; move to a better spot (with different strategies)
ask beekeepers ask beekeepers
[ move-to with-strategy-maximize-profit ] [ let s with-strategy-maximize-profit
if any? spots with [s = self]
[ move-to s]]
; collect honey and make money ; collect honey and make money
if ticks > 153 [ stop ]
tick tick
set yearly-ticks ticks mod 365
if yearly-ticks = 0 [ setup-seasons-uncertainty ]
end end
@#$#@#$#@ @#$#@#$#@
GRAPHICS-WINDOW GRAPHICS-WINDOW
@ -217,7 +222,7 @@ PENS
"Accacia" 1.0 0 -2674135 true "" "plot count beekeepers-on spots with [ flower-type = \"AC\" and acacia-season ]" "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 ]" "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 ]" "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\" ]" "Polyflower" 1.0 0 -8630108 true "" "plot count beekeepers-on spots with [ flower-type = \"PF\" and flower-season]"
PLOT PLOT
364 364
@ -255,6 +260,21 @@ season-uncertainty
NIL NIL
VERTICAL VERTICAL
SLIDER
215
50
253
246
d-max
d-max
0
30
30
1
1
NIL
VERTICAL
@#$#@#$#@ @#$#@#$#@
## WHAT IS IT? ## WHAT IS IT?

View File

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