Adding final zmap

This commit is contained in:
EEva 2013-07-18 02:02:10 +02:00
parent 00c6731815
commit ee97f86dfb
3 changed files with 121 additions and 34 deletions

View File

@ -7,20 +7,42 @@ end
to go-pollinate
if flower-season [
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 ]] ]
ask spots
[ ifelse any? beekeepers-here
[ set pollinisation-score amount-of-wild-hives + item 0 [amount-of-hives] of beekeepers-here ]
[ set pollinisation-score amount-of-wild-hives ]
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
;show max-pollinisation-score
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
;diffuse pcolor 0.1
end
to eleminate-and-germinate
let max-pollinisation-score max [ pollinisation-score ] of spots
;show max-pollinisation-score
; find low pollinated spots
ask spots with [ pollinisation-score / max-pollinisation-score <= elimination-threshold ]
[ die ]
let lucky-spots spots with [ pollinisation-score / max-pollinisation-score > elimination-threshold ]
; populate neighborhood of lucky spots
ask lucky-spots
[ hatch random-normal mean-new-spots 5
[ move-to one-of patches with [ distance myself < population-radius ] ] ]
; and reset pollinisation score
ask spots [ set pollinisation-score 0 ]
end

View File

@ -35,6 +35,7 @@ to setup
setup-spots
setup-beekeepers
setup-seasons-uncertainty
setup-wild-bees
end
@ -50,19 +51,18 @@ to go
[ let s with-collective-strategy
if any? spots with [ s = self ] [ set old-spot min-one-of spots [distance myself] move-to with-collective-strategy evaluation-procedure ] ]
if strategy = "with-blind-strategy" [ set old-spot min-one-of spots [distance myself] move-to with-blind-strategy evaluation-procedure ] ]
; collect honey and make money
go-pollinate
; tick!
tick
go-pollinate
set yearly-ticks ticks mod 365
if yearly-ticks = 0 [
setup-seasons-uncertainty
setup-new-season
]
if yearly-ticks = 0 [
setup-seasons-uncertainty
eleminate-and-germinate
setup-wild-bees ]
end
@#$#@#$#@
@ -94,10 +94,10 @@ ticks
30.0
BUTTON
10
10
83
43
60
531
133
564
NIL
setup\n
NIL
@ -141,10 +141,10 @@ NIL
VERTICAL
BUTTON
86
10
150
43
136
531
200
564
step
go
NIL
@ -184,10 +184,10 @@ NIL
VERTICAL
BUTTON
153
10
216
43
203
531
266
564
NIL
go
T
@ -291,7 +291,7 @@ max-wild-hives
max-wild-hives
0
100
52
10
1
1
NIL
@ -326,6 +326,62 @@ false
PENS
"default" 1.0 0 -16777216 true "" "plot averageProfit"
SLIDER
8
298
45
448
mean-new-spots
mean-new-spots
1
10
5
1
1
NIL
VERTICAL
SLIDER
47
299
84
448
elimination-threshold
elimination-threshold
0
1
0.1
0.1
1
NIL
VERTICAL
SLIDER
89
298
126
448
population-radius
population-radius
0
100
4
1
1
NIL
VERTICAL
SWITCH
125
490
286
523
per-county-init
per-county-init
0
1
-1000
@#$#@#$#@
## WHAT IS IT?

View File

@ -17,13 +17,22 @@ breed [ centroids centroid ]
patches-own [ county-name ]
to setup-spots
foreach county-names
[ create-spots amount-of-spt
[ set size 2
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 = ? and not any? centroids-here ] ] ]
ifelse per-county-init
[ foreach county-names
[ let ft one-of (list "PF" "AC" "LM" "SF")
create-spots amount-of-spt
[ set size 2
set shape "star"
set flower-type ft
set color color-flower flower-type
move-to one-of patches with [ county-name = ? and not any? centroids-here ] ] ] ]
[ foreach county-names
[ create-spots amount-of-spt
[ set size 2
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 = ? and not any? centroids-here ] ] ] ]
end
to setup-beekeepers
@ -56,4 +65,4 @@ end
to setup-new-season
set sumOfallBeekeepersProfit 0
set averageProfit 0
end
end