Adding zmap

This commit is contained in:
EEva 2013-07-17 23:58:24 +02:00
parent 796d085aca
commit f685ff89a6
4 changed files with 43 additions and 13 deletions

View File

@ -5,8 +5,22 @@ to setup-wild-bees
[ set amount-of-wild-hives random max-wild-hives ]
end
to pollinate
to go-pollinate
if flower-season [
ask spots
[ set pollinisation-score amount-of-wild-hives + [amount-of-hives] of beekeepers-here ] ]
ask spots with [any? beekeepers-here]
[ set pollinisation-score amount-of-wild-hives + item 0 [amount-of-hives] of beekeepers-here
;show pollinisation-score
if pollinisation-score > 0 [ set size 5 ]] ]
if pollinisation-map-on
[ clear-drawing
ask turtles [ hide-turtle ]
let max-pollinisation-score max [ pollinisation-score ] of spots
ask patches with [ any? spots-here ]
[ let local-pollinisation-score (item 0 [ pollinisation-score ] of spots-here)
set pcolor scale-color RED local-pollinisation-score 0 50
;set pcolor WHITE
;if local-pollinisation-score > 0 [ show local-pollinisation-score ]
] ]
diffuse pcolor 0.2
end

View File

@ -52,6 +52,8 @@ to go
; tick!
tick
go-pollinate
set yearly-ticks ticks mod 365
if yearly-ticks = 0 [ setup-seasons-uncertainty ]
@ -110,7 +112,7 @@ harvesting-uncertainty
harvesting-uncertainty
0
10
0
1.9
0.1
1
NIL
@ -124,8 +126,8 @@ SLIDER
travel-cost
travel-cost
0
5
5
10
7.5
0.1
1
NIL
@ -264,10 +266,10 @@ NIL
VERTICAL
CHOOSER
37
288
275
333
8
249
246
294
strategy
strategy
"with-collective-strategy" "with-blind-strategy"
@ -282,12 +284,23 @@ max-wild-hives
max-wild-hives
0
100
90
52
1
1
NIL
VERTICAL
SWITCH
4
455
206
488
pollinisation-map-on
pollinisation-map-on
0
1
-1000
@#$#@#$#@
## WHAT IS IT?

View File

@ -1,6 +1,9 @@
to-report with-collective-strategy
;; to explode. beekeeper do not know in advance
report max-one-of spots in-radius d-max with [ not any? beekeepers-here or member? myself beekeepers-here ] [ beekeep-utility flower-type ([amount-of-hives] of myself) (distance myself) ]
;let potential-empty-spots spots with [ not any? beekeepers-here or member? myself beekeepers-here ]
;let pes-radius-limited potential-empty-spots in-radius d-max
;report max-one-of pes-radius-limited [ beekeep-utility flower-type ([amount-of-hives] of myself) (distance myself) ]
report max-one-of (spots in-radius d-max) with [ not any? beekeepers-here or member? myself beekeepers-here ] [ beekeep-utility flower-type [amount-of-hives] of myself (distance myself) ]
end
to-report with-blind-strategy

View File

@ -13,7 +13,7 @@ to setup-spots
set shape "star"
set flower-type one-of (list "PF" "AC" "LM" "SF")
set color color-flower flower-type
move-to one-of patches with [ county-name = ? ] ] ]
move-to one-of patches with [ county-name = ? and not any? centroids-here ] ] ]
end
to setup-beekeepers