NetLogo作战模拟:将士兵放置在特定坐标之间?

NetLogo作战模拟:将士兵放置在特定坐标之间?,netlogo,Netlogo,我是NetLogo的新手,我不知道如何将300名斯巴达人排成一排。比如说一个2x5块的区域,海龟相互重叠。我试过使用sprout,这达到了特定的坐标要求,但是海龟们每个补丁只有一只。。这是我的一些代码 ask patches with [pxcor > 0 and pycor > -2 and pycor < 2] [ sprout 1 [ set color red ] ] or to setup-spartans create-spar

我是NetLogo的新手,我不知道如何将300名斯巴达人排成一排。比如说一个2x5块的区域,海龟相互重叠。我试过使用sprout,这达到了特定的坐标要求,但是海龟们每个补丁只有一只。。这是我的一些代码

    ask patches with [pxcor > 0 and pycor > -2 and pycor < 2]
    [ sprout 1 [ set color red ] ]

 or

    to setup-spartans
    create-spartans 300
    set-default-shape turtles "person"

    ask spartans
   [ setxy random-xcor -3  ;; makes only a single row and goes across entire screen  
                           ;; (I need it to be in a specific area)
     set heading 180
     set color red ]

    end
使用[pxcor>0和pycor>-2和pycor<2]询问补丁程序
[sprout 1[设置颜色为红色]]
或
设置斯巴达人
创建斯巴达300
将默认形状海龟设置为“人”
问问斯巴达人
[setxy random xcor-3;;只生成一行并穿过整个屏幕
(我需要它在一个特定的区域)
设置品目180
设置颜色[红色]
结束

像这样的东西怎么样

create-spartans 300 [
  set xcor -2 + random-float 5
  set ycor -1 + random-float 2
]