java.lang.Objectorg.nlogo.agent.AgentSet
public abstract class 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 |
|---|
public byte getAgentBit()
public Class<? extends Agent> type()
AgentSet
type in interface AgentSetpublic World world()
AgentSet
world in interface AgentSetpublic boolean isDirected()
public boolean isUndirected()
public void setDirected(boolean directed)
public void clearDirected()
public abstract int count()
AgentSet
count in interface AgentSetpublic boolean equalAgentSets(AgentSet otherSet)
AgentSet
equalAgentSets in interface AgentSetotherSet - the AgentSet to compare topublic String printName()
AgentSet
printName in interface AgentSetpublic abstract boolean isEmpty()
public abstract Agent agent(long i)
public abstract void add(Agent agent)
public abstract boolean contains(Agent agent)
public abstract Agent randomOne(int precomputedCount,
int random)
public AgentSet randomSubset(int resultSize,
int precomputedCount,
org.nlogo.util.MersenneTwisterFast randomerizer)
public abstract LogoList toLogoList()
public abstract Agent[] toArray()
public abstract AgentSet.Iterator iterator()
public abstract AgentSet.Iterator shufflerator(org.nlogo.util.MersenneTwisterFast random)
public Iterable<Agent> agents()
AgentSet
agents in interface AgentSet