我一直在寻找海龟,但我不明白。
我的想法是,我有一个昆虫种群(一种海龟),这个昆虫种群检查周围是否有可供筑巢的补丁。如果有一个,而没有其他昆虫种群,我希望这个斑块产生一个新的昆虫种群。到目前为止,我有这样的想法:
ask insect-populations
[
ask patches in-radius 2
[
if lay? = 1
[
if not any? insect-populations [ask self [sprout-insect-populations 1]]
]
]
]谢谢您的任何提示
发布于 2016-01-25 15:56:07
ask insect-populations
[
ask patches in-radius 2 with [lay? = 1 and not any? insect-populations-here]
[sprout-insect-populations 1]
]如果我能正确理解你的意图。诀窍在于和。它需要一个正确/错误的块。因此,在集合中包含方括号内的布尔语句的任何代理。
https://stackoverflow.com/questions/34991449
复制相似问题