问题
upon compilation I receive an error message saying set is the wrong commander before patch size 10 what commander should I use instead and why?
globals[road?]
to setup
clear-all
ask patches [set pcolor green]
end
to go
if mouse-down?
[ ask patch mouse-xcor mouse-ycor [ edit-world ]
end
to edit-world
if EDIT_TOOL = "Road"
[set pcolor grey
set patch-size 10
]
end
回答1:
The right command is set-patch-size
, with the hyphen after set
.
回答2:
Patch-size can not be changed programatically but only in settings.
All patches have the same size.
What are you trying to do simulation wise with that line? Patch-size should not effect any outcomes.
Edit: I was wrong Set-patch-size changes the size of all patches i.e. scales the view.
来源:https://stackoverflow.com/questions/26595121/is-the-placement-of-set-patch-size-within-my-code-correct-and-is-set-the-right-c