|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opt4j.core.AbstractIndividualFactory<I>
I - the type of Individualpublic class AbstractIndividualFactory<I extends Individual>
The 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.
| Field Summary | |
|---|---|
protected Creator<Genotype> |
creator
|
protected com.google.inject.Provider<I> |
individualProvider
|
protected java.util.Set<IndividualStateListener> |
individualStateListeners
|
| Constructor Summary | |
|---|---|
AbstractIndividualFactory(com.google.inject.Provider<I> individualProvider,
Creator<Genotype> creator)
Constructs an AbstractIndividualFactory with a Provider
for Individuals. |
|
| Method Summary | |
|---|---|
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. |
protected void |
injectListeners(java.util.Set<IndividualStateListener> listeners)
The IndividualStateListeners will be transmitted to each
Individual that is created by this class. |
void |
removeIndividualStateListener(IndividualStateListener listener)
Removes an IndividualStateListener that is invoked if the state
of any Individual changes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Creator<Genotype> creator
protected final com.google.inject.Provider<I extends Individual> individualProvider
protected final java.util.Set<IndividualStateListener> individualStateListeners
| Constructor Detail |
|---|
public AbstractIndividualFactory(com.google.inject.Provider<I> individualProvider,
Creator<Genotype> creator)
AbstractIndividualFactory with a Provider
for Individuals.
individualProvider - the provider that creates new individualscreator - the creator that creates random genotypes| Method Detail |
|---|
@Inject protected void injectListeners(java.util.Set<IndividualStateListener> listeners)
IndividualStateListeners will be transmitted to each
Individual that is created by this class. The listeners are
invoked if the state of the Individual changes.
listeners - the listenerspublic 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 individual
public 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)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||