Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Netlogo 如何在模型中的任意点聚集海龟?_Netlogo - Fatal编程技术网

Netlogo 如何在模型中的任意点聚集海龟?

Netlogo 如何在模型中的任意点聚集海龟?,netlogo,Netlogo,在我的模型中,我希望能够聚集我的代理,但要更改聚集的位置 目前,我可以使用 setxy random 4 random 4 但它位于模拟空间的原点附近。我如何改变这一点,使它们在每个模型运行的不同点聚集 谢谢我喜欢使用“请求补丁”来做这类事情,但您可以将代码更改为 手动设置束的方法 let clump-X random-pxcor let clump-Y random-pycor crt 100 ;; or however many you want to make the create-tu

在我的模型中,我希望能够聚集我的代理,但要更改聚集的位置

目前,我可以使用

setxy random 4 random 4
但它位于模拟空间的原点附近。我如何改变这一点,使它们在每个模型运行的不同点聚集


谢谢

我喜欢使用“请求补丁”来做这类事情,但您可以将代码更改为

手动设置束的方法

let clump-X random-pxcor
let clump-Y random-pycor
crt 100 ;; or however many you want to make the create-turtles in your code
  [
  ... 
  setxy (random 4 + clump-X) (random 4 + clump-Y)  
  ] 
  ask one-of patches
     [
     sprout 100
        [
        set xcor xcor + random 4
        set ycor ycor + random 4
        ]
     ]  
补片发芽法

let clump-X random-pxcor
let clump-Y random-pycor
crt 100 ;; or however many you want to make the create-turtles in your code
  [
  ... 
  setxy (random 4 + clump-X) (random 4 + clump-Y)  
  ] 
  ask one-of patches
     [
     sprout 100
        [
        set xcor xcor + random 4
        set ycor ycor + random 4
        ]
     ]