org.nlogo.agent
Class AgentSet

java.lang.Object
  extended by org.nlogo.agent.AgentSet
All Implemented Interfaces:
AgentSet
Direct Known Subclasses:
ArrayAgentSet, TreeAgentSet

public abstract class AgentSet
extends Object
implements AgentSet


Nested Class Summary
static interface AgentSet.Iterator
           
 
Method Summary
abstract  void add(Agent agent)
           
abstract  Agent agent(long i)
           
 Iterable<Agent> agents()
          Returns an iterable that cn be used to iterate through the agents in this set
 void clearDirected()
           
abstract  boolean contains(Agent agent)
           
abstract  int count()
          Returns the number of agents in the set
 boolean equalAgentSets(AgentSet otherSet)
          Reports true if this AgentSet and the given AgentSet have the exact same agents
 byte getAgentBit()
           
 boolean isDirected()
           
abstract  boolean isEmpty()
           
 boolean isUndirected()
           
abstract  AgentSet.Iterator iterator()
           
 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
abstract  Agent randomOne(int precomputedCount, int random)
           
 AgentSet randomSubset(int resultSize, int precomputedCount, org.nlogo.util.MersenneTwisterFast randomerizer)
           
 void setDirected(boolean directed)
           
abstract  AgentSet.Iterator shufflerator(org.nlogo.util.MersenneTwisterFast random)
           
abstract  Agent[] toArray()
           
abstract  LogoList toLogoList()
           
 Class<? extends Agent> type()
          Returns the type of agents in the AgentSet
 World world()
          Returns the world object that this AgentSet is associated with
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAgentBit

public byte getAgentBit()

type

public Class<? extends Agent> type()
Description copied from interface: AgentSet
Returns the type of agents in the AgentSet

Specified by:
type in interface AgentSet

world

public World world()
Description copied from interface: AgentSet
Returns the world object that this AgentSet is associated with

Specified by:
world in interface AgentSet

isDirected

public boolean isDirected()

isUndirected

public boolean isUndirected()

setDirected

public void setDirected(boolean directed)

clearDirected

public void clearDirected()

count

public abstract int count()
Description copied from interface: AgentSet
Returns the number of agents in the set

Specified by:
count in interface AgentSet

equalAgentSets

public boolean equalAgentSets(AgentSet otherSet)
Description copied from interface: AgentSet
Reports true if this AgentSet and the given AgentSet have the exact same agents

Specified by:
equalAgentSets in interface AgentSet
Parameters:
otherSet - the AgentSet to compare to

printName

public String printName()
Description copied from interface: AgentSet
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

Specified by:
printName in interface AgentSet

isEmpty

public abstract boolean isEmpty()

agent

public abstract Agent agent(long i)

add

public abstract void add(Agent agent)

contains

public abstract boolean contains(Agent agent)

randomOne

public abstract Agent randomOne(int precomputedCount,
                                int random)

randomSubset

public AgentSet randomSubset(int resultSize,
                             int precomputedCount,
                             org.nlogo.util.MersenneTwisterFast randomerizer)

toLogoList

public abstract LogoList toLogoList()

toArray

public abstract Agent[] toArray()

iterator

public abstract AgentSet.Iterator iterator()

shufflerator

public abstract AgentSet.Iterator shufflerator(org.nlogo.util.MersenneTwisterFast random)

agents

public Iterable<Agent> agents()
Description copied from interface: AgentSet
Returns an iterable that cn be used to iterate through the agents in this set

Specified by:
agents in interface AgentSet