Random 在NetLogo中调度随机代理子集以运行任务

Random 在NetLogo中调度随机代理子集以运行任务,random,task,subset,netlogo,Random,Task,Subset,Netlogo,我一直在开发一个程序,让“人类”特工向南移动到一个 从0600到1200小时进入森林,然后从1200到1800小时离开森林。 目前所有的人类特工都在早上6点开始进入。这会产生一种波动 效果,但我想要一个连续的人流。选择一 他们的想法是让一个随机的子集在0600开始移动,另一个 子集从0700开始,以此类推,直到1200时,它们全部掉头回去 出来或者,在每个位置生成一组新的“人类”可能会更好 早上的时间(即06000700080000010001100)移动,而不是 选择一个随机子集。我被困在这个

我一直在开发一个程序,让“人类”特工向南移动到一个 从0600到1200小时进入森林,然后从1200到1800小时离开森林。 目前所有的人类特工都在早上6点开始进入。这会产生一种波动 效果,但我想要一个连续的人流。选择一 他们的想法是让一个随机的子集在0600开始移动,另一个 子集从0700开始,以此类推,直到1200时,它们全部掉头回去 出来或者,在每个位置生成一组新的“人类”可能会更好 早上的时间(即06000700080000010001100)移动,而不是 选择一个随机子集。我被困在这个问题上有一段时间了,有什么帮助吗 非常感谢。我有下面的代码。 --尼尔

设置
ca
清除所有情节
净输出
第1组;这是森林外的农田
设置typeTrop 2;这是热带森林
询问补丁
[设定日期]

用[pycor question cross posted to The question]询问补丁有点模糊。你想知道什么?如何选择代理的随机子集?(很简单)。如何在不同的时间生成新的人类?你知道怎么做。哪个选项更好?其他人可能无法回答你。(最好发布一个最小工作示例(MWE),准确捕捉您不确定的内容。上面的代码有很多额外的材料,可以避免人们费心回答。)
to setup
ca
clear-all-plots
clear-output
set typeAgro 1 ;this is Agricultural land outside forest
set typeTrop 2 ;this is tropical forest
ask patches
[ set habitat typeAgro ]
ask patches with [pycor <= 300] ;all patches south of y-coord 300 is tropical
forest
[ set habitat typeTrop]
create-humans number-humans ;on a slider from 100 to 200
[ setxy random-xcor 310 ; start humans in agricultural land just north of
tropical forest
if any? turtles-on patch-here
[ setxy random-xcor 310 ]
set morning 6
set midday 12
set afternoon 18
set midnight 24
set step-size 50
set color white
set size 10
set shape "person" ]
reset-ticks
end

to go
tick
ask humans [move-humans] ; humans moving into the forest
end

to move-humans
let hour ticks mod midnight ; sets the ticks on 24 hour day

if morning <= hour and hour < midday [ ; from 0600 to 1200 people move into
forest
set heading (random-normal 180 30)
fd random-normal step-size 4
]
if midday <= hour and ycor < 310 [ ; from 1200 to 1800 people move out of the
forest
set heading (random-normal 360 30)
fd random-normal step-size 1
]
end