anthill
Interface Ant
- All Known Subinterfaces:
- GeneticAnt
- All Known Implementing Classes:
- RandomAnt
- public interface Ant
This interface contains the methods which must be implemented
by ant developers. The main method to be implemented is
run()
, which is invoked by a nest when an ant
is received. Method run()
contains the ant
algorithm.
Method Summary |
java.lang.String |
getSpecies()
Returns the identifier of the "species" of this ant.
|
void |
run(AntView view)
This method encapsulate the computation performed by ants.
|
run
public void run(AntView view)
- This method encapsulate the computation performed by ants.
It is invoked once by a nest when the ant is received by
another nest, or when the ant is generated locally. The
run()
method must be executed in a controlled
environment, meaning that the ant cannot be enabled to
access nest resources besides of the methods provided
by the AntView
interface.
- Parameters:
view
- reference to the AntView
object which
is the communication interface between ants and nests.
getSpecies
public java.lang.String getSpecies()
- Returns the identifier of the "species" of this ant.
Different ant species may have access to different
pheromone information in nests.