NetLogo:用于显示修补程序上海龟数量的修补程序
我想让每个补丁显示该补丁中海龟的数量。我知道我需要使用plabel命令,但我不知道如何告诉补丁显示占用它的海龟总数。有人知道怎么做吗?你可以通过“在这里数数海龟”轻松做到这一点 我提供了一个工作示例,但您的答案是“NetLogo:用于显示修补程序上海龟数量的修补程序,netlogo,Netlogo,我想让每个补丁显示该补丁中海龟的数量。我知道我需要使用plabel命令,但我不知道如何告诉补丁显示占用它的海龟总数。有人知道怎么做吗?你可以通过“在这里数数海龟”轻松做到这一点 我提供了一个工作示例,但您的答案是“在此设置plabel count turtles” to setup Clear-all Create-turtles 50 [move-to patch random 30 random 30] reset-ticks end to set-label ask
在此设置plabel count turtles
”
to setup
Clear-all
Create-turtles 50 [move-to patch random 30 random 30]
reset-ticks
end
to set-label
ask patches [
ifelse count turtles-here > 0
[set plabel count turtles-here]
[set plabel ""]
]
end
to go
ask turtles
[rt random 5
fd 0.3]
set-label
tick
end