jenes
Interface AlgorithmEventListener<T extends Chromosome>
- Type Parameters:
T
- extends Chromosome
public interface AlgorithmEventListener<T extends Chromosome>
AlgorithmEventListener
provides the interface for capturing events at algorithm level.
This iterface should be implemented by all classes interested in being notified by
algorithm events, that are:
- Start, when the algorithm evolution starts. The first step consists in initiliazing data structures, in particular populations.
- Init, when the initilization task is accomplished.
- Stop, when the evolution terminates.
An AlgorithmEventListener
is registered to the algorithm by the method GeneticAlgorithm.addAlgorithmEventListener(AlgorithmEventListener)
.
The listener is removed by invoking the method GeneticAlgorithm.removeAlgorithmEventListener(AlgorithmEventListener)
.
An AlgorithmEventListener can be registered to multiple different algorithms, thus being notified by all of them.
Another way to get notified of algorithms events is to override methods GeneticAlgorithm.onStart(long)
, GeneticAlgorithm.onInit(long)
and GeneticAlgorithm.onStop(long)
when subclassing the GeneticAlgorithm
class.
- Since:
- 1.0
- Version:
- 1.2
- Author:
- Luigi Troiano, Pierpaolo Lombardi, Giuseppe Pascale, Thierry Bodhuin
- See Also:
GeneticAlgorithm
onAlgorithmStart
void onAlgorithmStart(GeneticAlgorithm<T> ga,
long time)
- Invoked when the genetic algorithm starts
- Parameters:
ga
- the genetic algorithm that generated this event.time
- the event time expressed in milliseconds
onAlgorithmStop
void onAlgorithmStop(GeneticAlgorithm<T> ga,
long time)
- Invoked when the genetic algorithm ends
- Parameters:
ga
- the genetic algorithm that generated this event.time
- the event time expressed in milliseconds
onAlgorithmInit
void onAlgorithmInit(GeneticAlgorithm<T> ga,
long time)
- Invoked when the genetic algorithm is initialized
- Parameters:
ga
- the genetic algorithm that generated this event.time
- the event time expressed in milliseconds