当大多数代理群体具有相同的变量值但我真的不知道该怎么做时,我试图停止我的模拟。这是我的模型创建和过程的代码:
breed [birds bird]
birds-own [high]
to setup
create-turtles birds
[
set color blue
set shape "circle 2"
set xcor (-40 + random 25 )
set ycor (-40 + random 12)]
end
to go
ask birds
[
let Si4 [high] of one-of birds in-radius 1
let conc (( 4 * Si4) + ( 2 * Ai4 ) )
set high conc
]
end
我尝试使用不同的操作值来调节“高”变量,但是当至少 70-80% 的鸟类具有相同的“高”值时,我需要停止模拟。我尝试像这样使用命令“modes”和“max”:
if max modes [high] of cells > 55 [stop]
但这会停止模拟,即使 1 只鸟具有该值,如果大多数人口都具有该值,那么有什么建议可以正确执行此操作吗?