71 lines
1.8 KiB
Plaintext
71 lines
1.8 KiB
Plaintext
breed [ beekeepers beekeeper ]
|
|
beekeepers-own [
|
|
amount-of-hives
|
|
old-spot
|
|
chosen-spot
|
|
persistence-length
|
|
profit
|
|
total-travel-distance
|
|
]
|
|
|
|
breed [ spots spot ]
|
|
|
|
|
|
|
|
|
|
breed [ centroids centroid ]
|
|
patches-own [ county-name ]
|
|
|
|
to setup-spots
|
|
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
|
|
let temp 1
|
|
file-open "beekeepers-initial-location.txt"
|
|
while [not file-at-end?]
|
|
[
|
|
let amount-of-bk file-read
|
|
let location-bk file-read
|
|
create-beekeepers amount-of-bk
|
|
[ set shape "person"
|
|
set size 1
|
|
move-to one-of centroids-on patches with [ county-name = location-bk ]
|
|
if trace-on [ set color temp pd ]
|
|
set amount-of-hives random-normal 45 15 ]
|
|
set temp temp + 3
|
|
]
|
|
file-close
|
|
end
|
|
to setup-seasons-uncertainty
|
|
set abegin-uncertainty random-normal 0 season-uncertainty
|
|
set aend-uncertainty random-normal 0 season-uncertainty
|
|
set sbegin-uncertainty random-normal 0 season-uncertainty
|
|
set send-uncertainty random-normal 0 season-uncertainty
|
|
set lbegin-uncertainty random-normal 0 season-uncertainty
|
|
set lend-uncertainty random-normal 0 season-uncertainty
|
|
end
|
|
|
|
|
|
to setup-new-season
|
|
set sumOfallBeekeepersProfit 0
|
|
set averageProfit 0
|
|
set max-profit 0
|
|
set min-profit 0
|
|
end
|