I - the type of Individualpublic class AbstractIndividualFactory<I extends Individual> extends Object implements IndividualFactory
AbstractIndividualFactory creates Individuals using a
given Provider and sets the registered
IndividualStateListeners. The Creator is used to create the
problem specific Genotype with which the created Individual
is initialized.| Constructor and Description |
|---|
AbstractIndividualFactory(com.google.inject.Provider<I> individualProvider,
Creator creator)
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIndividualStateListener(IndividualStateListener listener)
Adds an
IndividualStateListener to each Individual that
is created by this class. |
Individual |
create()
Creates a new
Individual. |
Individual |
create(Genotype genotype)
Creates a new
Individual with a specified Genotype. |
void |
removeIndividualStateListener(IndividualStateListener listener)
Removes an
IndividualStateListener that is invoked if the state
of any Individual changes. |
public void addIndividualStateListener(IndividualStateListener listener)
IndividualFactoryIndividualStateListener to each Individual that
is created by this class. This listener is invoked if the state of the
Individual changes.addIndividualStateListener in interface IndividualFactorylistener - the listener that is invoked if the state of any individual
changesIndividualFactory.removeIndividualStateListener(org.opt4j.core.IndividualStateListener)public Individual create()
IndividualFactoryIndividual.create in interface IndividualFactorypublic Individual create(Genotype genotype)
IndividualFactoryIndividual with a specified Genotype.create in interface IndividualFactorygenotype - the genotype of the individualpublic void removeIndividualStateListener(IndividualStateListener listener)
IndividualFactoryIndividualStateListener that is invoked if the state
of any Individual changes. All Individuals created after
this method call by this IndividualFactory do no longer use the
listener.removeIndividualStateListener in interface IndividualFactorylistener - the listener that is invoked if the state of any individual
changesIndividualFactory.addIndividualStateListener(org.opt4j.core.IndividualStateListener)