org.nlogo.api
Interface AgentSet

All Known Implementing Classes:
AgentSet, ArrayAgentSet, TreeAgentSet

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

printName

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


count

int count()
Returns the number of agents in the set


type

Class<? extends Agent> type()
Returns the type of agents in the AgentSet


world

World world()
Returns the world object that this AgentSet is associated with


agents

Iterable<Agent> agents()
Returns an iterable that cn be used to iterate through the agents in this set


equalAgentSets

boolean equalAgentSets(AgentSet other)
Reports true if this AgentSet and the given AgentSet have the exact same agents

Parameters:
other - the AgentSet to compare to