Reputation: 215
How can a turtle find the nearest patch in 3D model? For 2D model, the code should be like this.
let nearest min-one-of (patches with [pcolor = green] ) [distance myself] ;
However, I tried to use distancexyz, and it does not work and it requires x, y and z coordinators. I am not sure how to get those coordinators of a turtle. Thanks.
Upvotes: 0
Views: 85
Reputation: 12580
distancexyz
takes coordinates as arguments, not an agent (patches are agents). You want distance
, as in distance nearest
.
Upvotes: 1