Gis 使海龟随机出现在特定的补丁上
使用GIS,我创建了一个城市的路线图。我希望海龟在设置过程中随机出现在道路的任何补丁上。我该怎么做呢?使用“n-of”、“with”和“sprout”命令将完成这项工作Gis 使海龟随机出现在特定的补丁上,gis,netlogo,Gis,Netlogo,使用GIS,我创建了一个城市的路线图。我希望海龟在设置过程中随机出现在道路的任何补丁上。我该怎么做呢?使用“n-of”、“with”和“sprout”命令将完成这项工作 to world ## This block will make the colors, ##you won't want to use th
to world ## This block will make the colors,
##you won't want to use this but it made the example reproducible
ask patches [set pcolor random 50]
end
to make_turtles
let Q 5 ##set this to the number of patches you want to spawn a turtle
ask n-of Q patches with [pcolor = 30] [sprout 1] ##tells Q number of random of patches with
##the desired character (in this case pcolor = 30)
## to sprout 1 turtle
end
您可以将[XXX]位更改为
with [ROAD=TRUE]
如果你想用一个可复制的例子来说明所拥有的变量,那么给你一个更有用的答案就更容易了。patches[roads?]
海龟们自己的[家园]
设置
设置驱动程序
结束
设置驱动程序的步骤创建驾驶员车辆数量[
使用[roads?=true]设置主修补程序中的一个修补程序
设置形状“飞机”
设置颜色25
设置大小8
移动到主补丁
]
结束