OC2PS
OC2PS

Reputation: 1079

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?

Upvotes: 0

Views: 2867

Answers (1)

OC2PS
OC2PS

Reputation: 1079

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

Upvotes: 2

Related Questions