【发布时间】:2015-12-01 12:34:46
【问题描述】:
在我的模型中,我希望一个龟品种(食物)记录许多其他品种(捕食者)到达它的顺序。
到目前为止,我有这段代码可以告诉我谁在那里,但不保留到达顺序:
if ticks = day-length [
print [who] of turtles-here with [who != [who] of myself]
任何建议都将一如既往地受到赞赏。如果提供更好的方法,我确实启动并运行了 RNetLogo。
谢谢
获取我想要的数据的一种丑陋方法是使用两行单独的代码
ask other turtles-here [show got-here]
foreach sort-by < [got-here] of turtles-here with [shape = "default"]
[
show ?
]]
【问题讨论】:
-
作为一般评论,使用
who几乎总是使NetLogo 代码更复杂,而不是更简单。相反,直接比较和操作海龟turtles-here with [who != [who] of myself]减少到turtles-here with [self != myself]或只是other turtles-here。
标签: netlogo