私は、「人間の」エージェントが 0600 から 1200 まで南下して森に入り、1200 から 1800 に森を離れる手順を開発しています。現在、すべての人間のエージェントは 0600 に歩き始めます。代わりに、継続的な人間の流れが必要です。私が考えたオプションの 1 つは、それらのランダムなサブセットを 0600 に移動し始め、別のサブセットを 0700 に開始し、1200 にそれらすべてが向きを変えて戻るまで続けることでした。別の方法として、ランダムなサブセットを選択する代わりに、移動する朝の時間 (つまり、0600、0700、0800、0900、1000、1100) ごとに新しい「人間」のセットを生成すると便利な場合があります。私はしばらくこれに固執しており、どんな助けでも大歓迎です。以下のコードがあります。――ニール
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