T
- extends Chromosomepublic interface GenerationEventListener<T extends Chromosome>
A GenerationEventListener
is registered to the algorithm by the method GeneticAlgorithm.addGenerationEventListener(GenerationEventListener)
.
The listener is removed by invoking the method GeneticAlgorithm.removeGenerationEventListener(GenerationEventListener)
.
A GenerationEventListener
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 method GeneticAlgorithm.onGeneration(long)
when subclassing the GeneticAlgorithm
class.
GeneticAlgorithm
Modifier and Type | Method and Description |
---|---|
void |
onGeneration(GeneticAlgorithm<T> ga,
long time)
Invoked when at the end of one generation step
|
void onGeneration(GeneticAlgorithm<T> ga, long time)
ga
- the genetic algorithm generating the eventtime
- the event time expressed in milliseconds