Nighthawk
Nighthawk

Reputation: 3

Netlogo: How to randomly select out of all neighbor patches that have a higher elevation?

I want my turtles to be able to assess which neighbour patches have a higher elevation than the current patch and then randomly select one of these higher elevation patches to move to.

Thank you very much in advance.

Upvotes: 0

Views: 537

Answers (1)

delaye
delaye

Reputation: 1399

You can use uphill primitive i.e. dictionary with something like

ask turtles [
   uphill elevation
]

EDIT You can use something like

ask tutles [
 let myelevPatch elevation patch-here
 let higherpatches patches in neighbors with [elevation > myelevPatch]
 move-to one-of higherpatches
]

Upvotes: 2

Related Questions