1
如何在海龟离开建筑物后激活报警时绘制直方图。我添加了这段代码,但是看起来好像工作不正常,时间也不正确。图中的时间假设在“疏散时间”监视器中不像时间显示一样。有人可以在这方面给我建议。先谢谢了。如何在netlogo中绘制图表
globals
[
percent-leader
flag-active-alarm
time-to-evacuate
flag-alarm
time-to-exits
]
to setup
clear-all
reset-ticks
set flag-active-alarm false
set time-to-exits []
setup-turtles
end
to go
ask turtles [wander fd 0.01]
if (flag-active-alarm)[active-alarm]
if all? turtles [ pcolor = red ] ;stops simulation
[ stop ]
if all? turtles [ pcolor = red ]
[
plot-time-to-exits
]
tick
end
to plot-time-to-exits
set-current-plot "PDF-Escape-Time"
set-plot-x-range min time-to-exits max time-to-exits
histogram time-to-exits
end