I have made a code for a land use change model but one part does not work properly. I'm not very experienced with Netlogo and and can't manage to find my mistake(s).
problem: the foreach part will not work although I copied it from the NETLOGO dictionary.
Netlogo dictionary (http://ccl.northwestern.edu/netlogo/docs/dict/foreach.html) gives:
(foreach list (turtle 1) (turtle 2) [3 4]
[ [the-turtle num-steps] -> ask the-turtle [ fd num-steps ] ])
;; turtle 1 moves forward 3 patches
;; turtle 2 moves forward 4 patches
I re-wrote this to my own models needs but Netlogo then reports " expected an anonymous command here, rather than a list or block"
my code:
to go
;; Sets Willingness to change true if patches are with more fellow patches than the scenario describes
(foreach list (Land-use = 1) (Land-use = 2) (Land-use = 3) (Land-use = 4) (Land-use = 5) (Land-use = 6) (Land-use = 7) [Senario1N Senario1L Senario1A Senario1B Senario1I Senario1R Senario1W]
[ [the-Land-use the-Scenario] - > ask patches [if count patches with [the-Land-use] > the-Scenario [ set Willingstochange True ] ] ])
;; Gives a score to atractivenesstochangein based on the ratio patches vs scenario
(foreach list (Land-use = 1) (Land-use = 2) (Land-use = 3) (Land-use = 4) (Land-use = 5) (Land-use = 6) (Land-use = 7) [Senario1N Senario1L Senario1A Senario1B Senario1I Senario1R Senario1W]
[ [the-Land-use the-Scenario] - > set atractivenesstochangein (count patches with [the-Land-use]/the-Scenario) ]
end
But also when I use the exact Netlogo dictionary example Netlogo reports the same problem