昆虫跟随领导者 - 我可以为此实现 Boids 算法吗?
我想说明昆虫如何在二维中跟随它们的领导者。 我怎样才能做到这一点? 用Boid算法可以做到这一点吗? 或者也许有人知道另一种专门为此原因设计的算法?
I would like to illustrate how insects are following their leader in 2 dimensions.
How can I acomplish that?
Is it possible to do this with Boids algorithm?
Or maybe someone knows another algorithm, designed especially for that reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Boids 风格的算法应该适合这种情况,但是在获得看起来非常好的东西之前,您可能需要调整算法并进行一些实验。如果您执行以下操作,您将获得类似于领导者/追随者行为的信息:
让“追随者”调整其朝向“领导者”的方向。根据您希望追随者效果有多强,您可以使该效果更弱或更强,或者仅在某些时候应用它等。
您可以选择让每个机器人跟随同一个领导者,或者每个机器人跟随一个不同的领导者。如果是前者,你会得到一大群人追随一个人。如果是后者,您往往会形成“链”。
您可能希望最终领导者能够相对独立地行动。也许让领导者随机改变方向,甚至尝试“远离”群体的中心。
Boids-style algorithms should be fine for this, however you will probably need to tweak the algorithm and experiment a bit before you get something that looks really good. You'll get something like leader/follower behaviours providing you do the following:
Get the "followers" to adjust their heading towards the "leader". Depending on how strong you want the follower effect to be you can make this effect weaker or stronger, or only apply it some of the time etc.
You may choose to either have every bot follow the same leader, or each follow a different leader. If the former, you will get a big flock following a single individual. If the latter, you will tend to get "chains" forming.
You'll probably want the ultimate leader(s) to move relatively independently. Maybe make the leader change heading randomly or even try to head "away" from the centre of the group.