如何在 netlogo 中围绕一只乌龟发芽?
how to sprout around a turtle in netlogo?
我一直在寻找海龟周围的传播,但我没有得到它。
我的想法是我有一个昆虫种群(一种海龟),这个昆虫种群会四处查看是否有可用的筑巢地块。如果有一个并且没有其他昆虫种群,我希望这个补丁产生一个新的昆虫种群。到目前为止,我有这个想法:
ask insect-populations
[
ask patches in-radius 2
[
if lay? = 1
[
if not any? insect-populations [ask self [sprout-insect-populations 1]]
]
]
]
提前感谢任何提示
ask insect-populations
[
ask patches in-radius 2 with [lay? = 1 and not any? insect-populations-here]
[sprout-insect-populations 1]
]
如果我理解正确的话,应该就是你想要的。
诀窍在于[with]。它需要一个 true/false 块。因此,集合中包含方括号内的布尔语句的任何代理。
我一直在寻找海龟周围的传播,但我没有得到它。
我的想法是我有一个昆虫种群(一种海龟),这个昆虫种群会四处查看是否有可用的筑巢地块。如果有一个并且没有其他昆虫种群,我希望这个补丁产生一个新的昆虫种群。到目前为止,我有这个想法:
ask insect-populations
[
ask patches in-radius 2
[
if lay? = 1
[
if not any? insect-populations [ask self [sprout-insect-populations 1]]
]
]
]
提前感谢任何提示
ask insect-populations
[
ask patches in-radius 2 with [lay? = 1 and not any? insect-populations-here]
[sprout-insect-populations 1]
]
如果我理解正确的话,应该就是你想要的。 诀窍在于[with]。它需要一个 true/false 块。因此,集合中包含方括号内的布尔语句的任何代理。