Search code examples
netlogoagent-based-modeling

How to find the closest turtle(s)?


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?


Solution

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