csss-beedza/Source/vmodel.nls

71 lines
1.8 KiB
Plaintext
Raw Normal View History

2013-07-17 11:33:47 +02:00
breed [ beekeepers beekeeper ]
2013-07-18 00:33:43 +02:00
beekeepers-own [
amount-of-hives
old-spot
chosen-spot
persistence-length
2013-07-18 01:14:36 +02:00
profit
total-travel-distance
2013-07-18 00:33:43 +02:00
]
2013-07-17 11:33:47 +02:00
2013-07-17 20:30:56 +02:00
breed [ spots spot ]
2013-07-18 00:33:43 +02:00
2013-07-17 11:33:47 +02:00
breed [ centroids centroid ]
patches-own [ county-name ]
to setup-spots
2013-07-18 02:02:10 +02:00
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 ] ] ] ]
2013-07-17 11:33:47 +02:00
end
to setup-beekeepers
2013-07-17 18:37:37 +02:00
let temp 1
2013-07-17 17:35:53 +02:00
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
2013-07-17 18:06:53 +02:00
move-to one-of centroids-on patches with [ county-name = location-bk ]
2013-07-17 20:23:15 +02:00
if trace-on [ set color temp pd ]
2013-07-17 21:12:45 +02:00
set amount-of-hives random-normal 45 15 ]
2013-07-17 18:37:37 +02:00
set temp temp + 3
2013-07-17 17:35:53 +02:00
]
file-close
2013-07-17 16:10:47 +02:00
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
2013-07-17 20:30:56 +02:00
end
2013-07-18 00:33:43 +02:00
to setup-new-season
set sumOfallBeekeepersProfit 0
set averageProfit 0
2013-07-18 02:33:44 +02:00
set max-profit 0
set min-profit 0
2013-07-18 02:02:10 +02:00
end