|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jabm.agent.AgentList
public class AgentList
A list of agents.
![]() |
![]() |
![]() |
![]() |
Field Summary | |
---|---|
protected org.springframework.beans.factory.ObjectFactory<Agent> |
agentFactory
|
protected java.util.List<Agent> |
agents
The agents comprising this list. |
static java.util.Comparator<Agent> |
ascendingFitnessComparator
|
static java.util.Comparator<Agent> |
descendingFitnessComparator
|
protected int |
size
|
Constructor Summary | |
---|---|
AgentList()
Create an empty AgentList. |
|
AgentList(Agent agent)
Create a list comprising a single agent. |
|
AgentList(java.util.ArrayList<AgentList> lists)
Create an AgentList by merging a list of AgentList objects. |
|
AgentList(java.util.Collection<Agent> agents)
Create an AgentList from the supplied Collection of agents. |
|
AgentList(int size)
Create an empty AgentList with the specified capacity. |
|
AgentList(int size,
org.springframework.beans.factory.ObjectFactory<Agent> agentFactory)
Create an AgentList by manufacturing objects from the supplied factory. |
Method Summary | |
---|---|
void |
add(Agent agent)
|
boolean |
addAll(java.util.Collection<? extends Agent> c)
|
Agent |
get(int i)
|
org.springframework.beans.factory.ObjectFactory<Agent> |
getAgentFactory()
|
java.util.List<Agent> |
getAgents()
|
double |
getMaxFitness()
|
int |
getSize()
|
double |
getTotalFitness()
|
java.util.Iterator<Agent> |
iterator()
|
void |
populateFromFactory()
|
Agent |
remove(int index)
|
void |
set(int i,
Agent agent)
|
void |
setAgentFactory(org.springframework.beans.factory.ObjectFactory<Agent> agentFactory)
|
void |
setAgents(java.util.List<Agent> agents)
|
void |
setSize(int size)
|
void |
shuffle(cern.jet.random.engine.RandomEngine prng)
Randomly sort the agents in this list. |
int |
size()
|
void |
sortAgents(java.util.Comparator<Agent> comparator)
|
void |
sortAgentsByFitness()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Agent> agents
protected int size
protected org.springframework.beans.factory.ObjectFactory<Agent> agentFactory
public static final java.util.Comparator<Agent> ascendingFitnessComparator
public static final java.util.Comparator<Agent> descendingFitnessComparator
Constructor Detail |
---|
public AgentList(int size)
size
- public AgentList()
public AgentList(Agent agent)
agent
- public AgentList(java.util.Collection<Agent> agents)
agents
- public AgentList(java.util.ArrayList<AgentList> lists)
lists
- An ArrayList holding an array of AgentList objects.public AgentList(int size, org.springframework.beans.factory.ObjectFactory<Agent> agentFactory)
size
- The number of agents to manufacture.agentFactory
- The factory used to manufacture agents.Method Detail |
---|
public void populateFromFactory()
public Agent get(int i)
public void set(int i, Agent agent)
public void add(Agent agent)
public boolean addAll(java.util.Collection<? extends Agent> c)
public Agent remove(int index)
public java.util.List<Agent> getAgents()
public java.util.Iterator<Agent> iterator()
public int size()
public void setAgents(java.util.List<Agent> agents)
public double getTotalFitness()
public double getMaxFitness()
public void shuffle(cern.jet.random.engine.RandomEngine prng)
prng
- public void sortAgentsByFitness()
public void sortAgents(java.util.Comparator<Agent> comparator)
public int getSize()
public void setSize(int size)
public org.springframework.beans.factory.ObjectFactory<Agent> getAgentFactory()
public void setAgentFactory(org.springframework.beans.factory.ObjectFactory<Agent> agentFactory)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |