Raj
Raj

Reputation: 1071

Print the elements in an agentset

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

Upvotes: 6

Views: 1222

Answers (1)

Alan
Alan

Reputation: 9620

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]

Upvotes: 9

Related Questions