如何找到最近的海龟? [英] How to find the closest turtle(s)?

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

问题描述

NetLogo 命令 distance 可用于查找乌龟与另一只乌龟的距离.
但是,我正在寻找每只海龟都能够找到具有最小总和 [距它的距离 + 价格(海龟变量)] 的海龟.我怎样才能让乌龟做到这一点?

NetLogo command distance <agent> can be used to find the distance of a turtle from another turtle.
However, I am looking for each turtle to be able to find the turtle(s) with the smallest sum of [distance from it + price(a turtle variable)]. How can I get the turtles to do that?

推荐答案

@JenB 的评论帮我解决了.
设置匹配卖家最小一个卖家[距离我自己+价格]

@JenB 's comment helped me solve it.
set matchedseller min-one-of sellers [distance myself + price ]

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

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