Some slight changes
This commit is contained in:
parent
0486cb9934
commit
422f1d5bb5
|
@ -20,20 +20,21 @@ to setup
|
|||
ask county-labels [ die ]
|
||||
|
||||
foreach gis:feature-list-of romanian-county-borders-dataset
|
||||
[ ;gis:set-drawing-color item random 14 base-colors
|
||||
;gis:fill ? 0
|
||||
let county-color item random 14 base-colors
|
||||
[ gis:set-drawing-color item random 14 base-colors
|
||||
gis:fill ? 0
|
||||
|
||||
;let county-color item random 14 base-colors
|
||||
ask patches gis:intersecting ?
|
||||
[ set county-name gis:property-value ? "NAME_1"
|
||||
set pcolor county-color ] ]
|
||||
;set pcolor county-color ] ]
|
||||
|
||||
end
|
||||
@#$#@#$#@
|
||||
GRAPHICS-WINDOW
|
||||
463
|
||||
5
|
||||
708
|
||||
223
|
||||
877
|
||||
440
|
||||
-1
|
||||
-1
|
||||
4.0
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
globals [
|
||||
globals
|
||||
[
|
||||
nx ny
|
||||
nb-beekeepers
|
||||
max-distance-of-moving
|
||||
|
@ -8,7 +9,6 @@ globals [
|
|||
sunflower-price
|
||||
hivesProd
|
||||
fuelPriceByKm ;;; euros by km
|
||||
|
||||
]
|
||||
|
||||
breed [ beekeepers beekeeper ]
|
||||
|
@ -172,36 +172,31 @@ end
|
|||
to follow-strategy
|
||||
;;; its depends of the strategy of the turtle , calibrate in the initialisation
|
||||
if strategy-of-turtle = 1 [ ;;; choose a random spot
|
||||
let counties-around other counties in-radius max-distance-of-moving
|
||||
set chosen-county one-of counties-around
|
||||
;;;;;
|
||||
cost-of-moving
|
||||
;;;;;
|
||||
move-to chosen-county
|
||||
|
||||
ask chosen-county[ ;;;;;;;;; PROBELMMMMMMMMMMMMMMMMMMMMMM;;;;;;;;;;;;;;
|
||||
|
||||
let spots-on-county turtles-here
|
||||
let available-spots spots with [availability = 0] ;; free
|
||||
ifelse any? available-spots
|
||||
[ ;;; there are available spots
|
||||
let best-spot max-one-of available-spots [ utility ]
|
||||
|
||||
set current-spot best-spot
|
||||
move-to best-spot
|
||||
ask best-spot [ set availability 1]
|
||||
|
||||
|
||||
[;;;; there arent available spots
|
||||
|
||||
follow-strategy
|
||||
]
|
||||
|
||||
]
|
||||
|
||||
]
|
||||
|
||||
]
|
||||
let counties-around other counties in-radius max-distance-of-moving
|
||||
set chosen-county one-of counties-around
|
||||
;;;;;
|
||||
cost-of-moving
|
||||
;;;;;
|
||||
move-to chosen-county
|
||||
|
||||
ask chosen-county[ ;;;;;;;;; PROBELMMMMMMMMMMMMMMMMMMMMMM;;;;;;;;;;;;;;
|
||||
|
||||
let spots-on-county turtles-here
|
||||
let available-spots spots with [availability = 0] ;; free
|
||||
ifelse any? available-spots
|
||||
[ ;;; there are available spots
|
||||
let best-spot max-one-of available-spots [ utility ]
|
||||
|
||||
set current-spot best-spot
|
||||
move-to best-spot
|
||||
ask best-spot [ set availability 1] ]
|
||||
|
||||
|
||||
[;;;; there arent available spots
|
||||
|
||||
follow-strategy
|
||||
] ] ]
|
||||
|
||||
if strategy-of-turtle = 2 [ ;;;; choose the nearest county
|
||||
|
||||
]
|
||||
|
@ -272,8 +267,8 @@ GRAPHICS-WINDOW
|
|||
1
|
||||
1
|
||||
0
|
||||
0
|
||||
0
|
||||
1
|
||||
1
|
||||
1
|
||||
-23
|
||||
23
|
||||
|
|
Loading…
Reference in New Issue