我是Netlogo的新手,在编程方面取得了很好的进步。然而,我现在被一个问题卡住了。
我使用海龟作为鱼类的超级个体(参见Railsback和Grimm 2005),这意味着每只海龟都有关于丰度、性别、年龄和大小的论据。在一年的周期结束时,我希望找到具有相同性别、年龄和大小特征的海龟,然后将它们的数量组合成一个具有相同特征的海龟(然后除了新组合的海龟之外,所有的海龟都将死亡)。有人知道怎么做吗?任何建议都将不胜感激。
发布于 2019-11-13 04:36:47
我没有测试我的解决方案,但这应该是可行的。基本上,对于每只海龟,找出谁是具有相同属性的海龟,并将其添加到运行的丰度总数中,然后要求它们死亡。
ask turtles [
let others-abundance 0 ;; accumulate other's abundances
ask other turtles with [ sex = [sex] of myself and abundance = [abundance] of myself and age = [age] of myself] and size = [size] of myself] ;;determine who are the others with same properties
[
set others-abundance other-abundance + abundance
die
]
set abundance abundance + other-abundance]
https://stackoverflow.com/questions/58824621
复制相似问题