csss-beedza/Source/bmodel.nls

47 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2013-07-17 20:23:15 +02:00
spots-own [ flower-type pollinisation-score amount-of-wild-hives ]
2013-07-17 19:10:41 +02:00
2013-07-17 20:23:15 +02:00
to setup-wild-bees
ask spots
2013-07-17 21:12:45 +02:00
[ set amount-of-wild-hives random max-wild-hives ]
2013-07-17 19:10:41 +02:00
end
2013-07-17 23:58:24 +02:00
to go-pollinate
2013-07-17 21:12:45 +02:00
if flower-season [
2013-07-18 02:02:10 +02:00
ask spots
[ ifelse any? beekeepers-here
[ set pollinisation-score amount-of-wild-hives + item 0 [amount-of-hives] of beekeepers-here ]
2013-07-18 02:06:23 +02:00
[ set pollinisation-score amount-of-wild-hives ] ] ]
2013-07-17 23:58:24 +02:00
if pollinisation-map-on
[ clear-drawing
ask turtles [ hide-turtle ]
let max-pollinisation-score max [ pollinisation-score ] of spots
2013-07-18 02:02:10 +02:00
;show max-pollinisation-score
2013-07-17 23:58:24 +02:00
ask patches with [ any? spots-here ]
[ let local-pollinisation-score (item 0 [ pollinisation-score ] of spots-here)
2013-07-18 16:39:45 +02:00
set pcolor scale-color RED local-pollinisation-score 0 60
2013-07-17 23:58:24 +02:00
;set pcolor WHITE
;if local-pollinisation-score > 0 [ show local-pollinisation-score ]
] ]
2013-07-18 02:02:10 +02:00
;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 ]
2013-07-17 19:10:41 +02:00
end