public interface AgentSet
Interface provides access to NetLogo agentsets. NetLogo agentsets may be composed of turtles, patches, or links (but an agentset may not contain a mix of different agent types.) In order to perform some functions on AgentSets you may need to cast to org.nlogo.agent.AgentSet.
Method Summary | |
---|---|
Iterable<Agent> |
agents()
Returns an iterable that cn be used to iterate through the agents in this set |
int |
count()
Returns the number of agents in the set |
boolean |
equalAgentSets(AgentSet other)
Reports true if this AgentSet and the given AgentSet have the exact same agents |
String |
printName()
Returns the name of the AgentSet, for all turtles, patches, or links returns its type, for breeds returns the breed name for all other sets returns an empty string |
Class<? extends Agent> |
type()
Returns the type of agents in the AgentSet |
World |
world()
Returns the world object that this AgentSet is associated with |
Method Detail |
---|
String printName()
int count()
Class<? extends Agent> type()
World world()
Iterable<Agent> agents()
boolean equalAgentSets(AgentSet other)
other
- the AgentSet to compare to