NetLogo 在特定坐标处初始化海龟

NetLogo Initializing Turtles at Specific Co-Ordinates

在 NetLogo 模型中,我在 space 中有一些 "plant" 海龟。其中的个数是5,永远是5。

set-default-shape plants "plant"
create-plants 10
[
  set color green
  set size 2  
  setxy random-xcor random-ycor
  setxy random-xcor random-ycor
]

目前,这些植物中的每一种都在世界上随机生成。我希望能够设置每个植物的放置点。

类似于:

setxy plant-1 25 25
setxy plant-2 25 25

有什么办法可以实现吗?

目前,setxy random-xcor random-ycor 行正在将植物的 x 坐标和 y 坐标设置为随机值。请注意,您的代码中似乎有该行两次。它的第一个实例被第二个实例覆盖。无论如何,您也可以使用 setxy 将植物移动到特定坐标,例如setxy 25 25。但是,将 setxy random-xcor random-ycor 替换为 setxy 25 25 会在该位置放置 all 植物。我假设您希望在多个特定位置拥有多个工厂。要做到这一点,你可以只要求个别植物移动:

ask plant 0 [ setxy 25 25 ]
ask plant 1 [ setxy 10 40 ]

等等。