Is the placement of set patch-size within my code correct and is set the right command to use?

六月ゝ 毕业季﹏ 提交于 2019-12-31 07:56:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!