Print the elements in an agentset

1.1k Views Asked by At

I want to find the patches which satisfy certain conditions, using the following command:

print patches with [ (closest-party = turtle 1) and (distance < 10)]

give this as the result: (agentset, 7 patches)

how do i find those 7 patches inside that agentset

1

There are 1 best solutions below

1
On BEST ANSWER

If myset is an agentset, then [self] of myset will be a list of the agents.

let myset patches with [ (closest-party = turtle 1) and (distance < 10)] print [self] of myset

But usually you can just work with myset. E.g.,

ask myset [print self]