|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.framework.Colony
public class Colony
This class represents a colony of artificial ants.
Field Summary | |
---|---|
static java.lang.String |
COLONY_SIZE
The property key under which the colony size value is stored. |
static int |
DEFAULT_COLONY_SIZE
The default colony size. |
Constructor Summary | |
---|---|
Colony()
Default constructor. |
|
Colony(int size)
Creates a new colony. |
Method Summary | |
---|---|
Ant |
getBest()
Returns the best ant (the ant with the highest trail) of the colony. |
Ant |
getCurrent()
Returns the current best ant (the ant with the highest trail) of the colony. |
java.util.List<Ant> |
getPopulation()
Returns the population of ants. |
int |
getSize()
Returns the colony size. |
TrailFactory |
getTrailFactory()
Returns the trail factory. |
protected void |
initialize()
Initializes the population of ants. |
void |
setTrailFactory(TrailFactory factory)
Sets the trail factory. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COLONY_SIZE
public static final int DEFAULT_COLONY_SIZE
Constructor Detail |
---|
public Colony()
public Colony(int size)
size
- the colony size.Method Detail |
---|
protected void initialize()
public int getSize()
public TrailFactory getTrailFactory()
public void setTrailFactory(TrailFactory factory)
factory
- the TrailFactory
to set.public java.util.List<Ant> getPopulation()
public Ant getBest()
public Ant getCurrent()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |