不知道这个对你有没有用?这是一个程序中的一小段,也许修改一下可以达到目的。
let cnmoney 100
let i 0
while [i < cnmoney]
[
let tmoney total_money / 50
let num (count turtles with [(money >= i * tmoney / cnmoney) and (money < (i + 1) * tmoney / cnmoney)])
plot (num * 100 / num_agents)
set i i + 1
]