你的問題不是很清楚,如果你想能夠設置你應該使用隱藏的龜的可見性?原始設置龜的可見性, 下面的例子顯示了當他們的身份證小於蜱時龜如何出現,在蜱101中,所有的龜都將是可見的。
to setup
clear-all
reset-ticks
crt 100 [
set hidden? true
setxy random 19 random 80
]
end
to go
ask turtles
[
if who < ticks
[
set hidden? false
fd 1
]
]
ask patch 0 0 [set plabel ticks] ; just for your info
ask patch 1 1 [set plabel "Ticks"] ; just for your info
tick
end
後1個滴答只有一個烏龜可見:
現在40個龜可見:
更新:
在這個例子中,你可以有你要問龜自己的知名度設置爲true號碼清單:
globals [ number-to-set-visible]
to setup
clear-all
reset-ticks
set number-to-set-visible [ 5 5 7 8 2 ]
crt 100 [
set hidden? true
setxy random 19 random 80
]
end
to go
if visibility-condition and length number-to-set-visible > 0
[
ask n-of item 0 number-to-set-visible turtles [
set hidden? false
]
set number-to-set-visible remove-item 0 number-to-set-visible
]
ask turtles with [not hidden? ]
[
fd 1
]
tick
end
to-report visibility-condition
report ticks mod 100 = 0 and ticks > 0
end
你能更清楚明確地知道你想要發生什麼嗎?我不明白你的描述。 –
就像我開始安裝時,我不希望所有的100只烏龜出現。就像第5只烏龜會出現,然後當它開始出現時,另外5只會出現,接下來的7或8或2等等,直到100出來。 – user3146700
您可能會在示例模型的生物學部分查看Ant Lines模型,該模型有螞蟻逐漸出現。 –