|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.framework.Ant
public class Ant
This class represents an artificial ant.
Field Summary | |
---|---|
static int |
MINIMUM_MEMORY_SIZE
The minimum memory size allowed. |
Constructor Summary | |
---|---|
Ant(Colony colony)
Creates a new ant. |
|
Ant(Colony colony,
int memory)
Creates a new ant. |
Method Summary | |
---|---|
int |
compareTo(Ant o)
|
Trail |
getBestTrail()
Returns the best trail constructed by the ant. |
java.util.List<Trail> |
getMemory()
Returns the ordered (descendant order) ant trail memory list. |
Trail |
getTrail()
Returns the current ant trail. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Updates the memory status when a trail has its cost associated. |
void |
setTrail(Trail trail)
Sets the current ant trail. |
java.lang.String |
toString()
|
Trail |
walk()
Creates a new trail by walking in the problem construction graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MINIMUM_MEMORY_SIZE
Constructor Detail |
---|
public Ant(Colony colony)
colony
- the colony of the ant.public Ant(Colony colony, int memory)
colony
- the colony of the ant.memory
- the ant memory size.Method Detail |
---|
public Trail walk()
public java.util.List<Trail> getMemory()
public Trail getTrail()
public Trail getBestTrail()
public void setTrail(Trail trail)
trail
- the trail to set.public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- the PropertyChangeEvent
instance.public int compareTo(Ant o)
compareTo
in interface java.lang.Comparable<Ant>
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 |