如何使Netlogo中的海龟死亡 [英] How to make turtles in netlogo die

查看:291
本文介绍了如何使Netlogo中的海龟死亡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使乌龟死亡方面遇到麻烦. 是否有可能使海龟在某些滴答声后死亡? 如果是,您如何做? 请帮忙!

I'm having trouble in making the turtles die. Is it possible to make the turtles die after certain ticks? If yes, how do you do you do it? Please help!

谢谢

推荐答案

是的,如果您希望所有的海龟在100个滴答声后都死掉,这就是代码. if ticks > 100 [ ask turtles [ die ] ].当然,如果所有海龟都死了,您可能希望改为停止仿真.

Yes, this is the code if you want all the turtles to die after 100 ticks. if ticks > 100 [ ask turtles [ die ] ]. Of course, if all the turtles die, you probably want the simulation to stop instead.

这篇关于如何使Netlogo中的海龟死亡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆