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
Agents are beings that can follow instructions. In NetLogo, there are four types of agents: turtles, patches, links, and the observer. Turtles are agents that move around in the world. The world is two dimensional and is divided up into a grid of patches.
What programming language was NetLogo written in? NetLogo is written mostly in Scala, with some parts in Java. (Scala code compiles to Java byte code and is fully interoperable with Java and other JVM languages.)
The turtles-own keyword, like the globals, breed, <breeds>-own, and patches-own keywords, can only be used at the beginning of a program, before any function definitions. It defines the variables belonging to each turtle. If you specify a breed instead of "turtles", only turtles of that breed have the listed variables.
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]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With