net.sf.myra.framework
Class Colony

java.lang.Object
  extended by net.sf.myra.framework.Colony

public class Colony
extends java.lang.Object

This class represents a colony of artificial ants.

Version:
$Revision$ $Date:: $
Author:
Fernando Esteban Barril Otero

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

COLONY_SIZE

public static final java.lang.String COLONY_SIZE
The property key under which the colony size value is stored.

See Also:
Constant Field Values

DEFAULT_COLONY_SIZE

public static final int DEFAULT_COLONY_SIZE
The default colony size.

See Also:
Constant Field Values
Constructor Detail

Colony

public Colony()
Default constructor.


Colony

public Colony(int size)
Creates a new colony.

Parameters:
size - the colony size.
Method Detail

initialize

protected void initialize()
Initializes the population of ants.


getSize

public int getSize()
Returns the colony size.

Returns:
the colony size.

getTrailFactory

public TrailFactory getTrailFactory()
Returns the trail factory.

Returns:
the trail factory.

setTrailFactory

public void setTrailFactory(TrailFactory factory)
Sets the trail factory.

Parameters:
factory - the TrailFactory to set.

getPopulation

public java.util.List<Ant> getPopulation()
Returns the population of ants.

Returns:
the population of ants.

getBest

public Ant getBest()
Returns the best ant (the ant with the highest trail) of the colony.

Returns:
the best ant of the colony.

getCurrent

public Ant getCurrent()
Returns the current best ant (the ant with the highest trail) of the colony.

Returns:
the current best ant of the colony.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2013. All Rights Reserved.