add profit

This commit is contained in:
Fabien 2013-07-18 01:14:36 +02:00
parent 2c1f7d4b41
commit 00c6731815
3 changed files with 20 additions and 5 deletions

View File

@ -86,9 +86,14 @@ end
to dailyRevenue
let N count beekeepers
; ifelse old-spot not empty? [
set old-spot min-one-of spots [distance myself]
; let travel-distance distance spot one-of old-spot]
let travel-distance 0
let travel-distance distance old-spot
; ]
;[
; set travel-distance 0
;]
if any? spots-here [;flower-type [amount-of-hives] of myself (distance myself)
set sumOfallBeekeepersProfit (sumOfallBeekeepersProfit + beekeep-utility ([flower-type] of one-of spots-here) amount-of-hives travel-distance )
]
@ -102,5 +107,12 @@ end
to evaluation-procedure
dailyRevenue
individual-caract
end
to individual-caract
let travel-distance distance old-spot
set profit (profit + beekeep-utility ([flower-type] of one-of spots-here) amount-of-hives travel-distance )
set total-travel-distance (total-travel-distance + travel-distance )
end

View File

@ -12,6 +12,7 @@ globals [
lend-uncertainty
averageProfit
sumOfallBeekeepersProfit
]
__includes [
@ -47,8 +48,8 @@ to go
ask beekeepers
[ if strategy = "with-collective-strategy"
[ let s with-collective-strategy
if any? spots with [ s = self ] [ set old-spot [who] of spots-here move-to with-collective-strategy evaluation-procedure ] ]
if strategy = "with-blind-strategy" [ set old-spot [who] of spots-here move-to with-blind-strategy evaluation-procedure ] ]
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
@ -279,7 +280,7 @@ CHOOSER
strategy
strategy
"with-collective-strategy" "with-blind-strategy"
0
1
SLIDER
213

View File

@ -4,6 +4,8 @@ beekeepers-own [
old-spot
chosen-spot
persistence-length
profit
total-travel-distance
]
breed [ spots spot ]