Fixing buggy behaviour

This commit is contained in:
EEva 2013-07-18 03:00:30 +02:00
parent dc21690af7
commit 5ae1ecf1ca
2 changed files with 21 additions and 19 deletions

View File

@ -53,19 +53,21 @@ to go
ask beekeepers
[ if strategy = "with-collective-strategy"
[ 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 any? spots with [ s = self ] [ set old-spot min-one-of spots [distance myself] move-to s evaluation-procedure ] ]
if strategy = "with-blind-strategy" [
set old-spot min-one-of spots [distance myself]
move-to with-blind-strategy
let s with-collective-strategy
ifelse any? spots with [ s = self ]
[ set old-spot min-one-of spots [distance myself]
move-to with-blind-strategy
if any? other beekeepers-here [ come-back ]
evaluation-procedure ]
[ move-to self ]
;let present-beekeepers other beekeepers
if any? other beekeepers-here[
come-back
]
evaluation-procedure
]
]
; collect honey and make money
go-pollinate
; tick!
tick
@ -76,12 +78,13 @@ to go
setup-new-season
evaluate-best-worst
setup-beekeepers-new-season
]
eleminate-and-germinate ]
end
to evaluate-best-worst
ask beekeepers [
if profit > max-profit [set max-profit profit]
@ -286,7 +289,7 @@ season-uncertainty
season-uncertainty
0
20
10
4
0.1
1
NIL
@ -339,7 +342,7 @@ SWITCH
488
pollinisation-map-on
pollinisation-map-on
1
0
1
-1000
@ -413,7 +416,7 @@ SWITCH
523
per-county-init
per-county-init
1
0
1
-1000
@ -782,7 +785,7 @@ Polygon -7500403 true true 270 75 225 30 30 225 75 270
Polygon -7500403 true true 30 75 75 30 270 225 225 270
@#$#@#$#@
NetLogo 5.0.3
NetLogo 5.0.4
@#$#@#$#@
@#$#@#$#@
@#$#@#$#@

View File

@ -3,14 +3,13 @@ to-report with-collective-strategy
;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) ]
set persistence-length d-max
set persistence-length d-max
let available-spots spots in-radius persistence-length
ifelse any? available-spots [
report max-one-of available-spots with [ not any? beekeepers-here or member? myself beekeepers-here ] [ beekeep-utility flower-type [amount-of-hives] of myself (distance myself) ]
report max-one-of available-spots with [ not any? beekeepers-here or member? myself beekeepers-here ] [ beekeep-utility flower-type [amount-of-hives] of myself (distance myself) ]
]
[
set persistence-length persistence-length + d-max
]
[ set persistence-length persistence-length + d-max
report n-of 0 spots ]
end
to-report with-blind-strategy