Package org.opt4j.core
Interface IndividualFactory
-
- All Known Implementing Classes:
AbstractIndividualFactory
,DefaultIndividualFactory
,ParticleFactory
public interface IndividualFactory
TheIndividualFactory
is a creator forIndividual
s.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addIndividualStateListener(IndividualStateListener listener)
Adds anIndividualStateListener
to eachIndividual
that is created by this class.Individual
create()
Creates a newIndividual
.Individual
create(Genotype genotype)
Creates a newIndividual
with a specifiedGenotype
.void
removeIndividualStateListener(IndividualStateListener listener)
Removes anIndividualStateListener
that is invoked if the state of anyIndividual
changes.
-
-
-
Method Detail
-
create
Individual create()
Creates a newIndividual
.- Returns:
- the built individual
-
create
Individual create(Genotype genotype)
Creates a newIndividual
with a specifiedGenotype
.- Parameters:
genotype
- the genotype of the individual- Returns:
- the built individual
-
addIndividualStateListener
void addIndividualStateListener(IndividualStateListener listener)
Adds anIndividualStateListener
to eachIndividual
that is created by this class. This listener is invoked if the state of theIndividual
changes.- Parameters:
listener
- the listener that is invoked if the state of any individual changes- See Also:
removeIndividualStateListener(org.opt4j.core.IndividualStateListener)
-
removeIndividualStateListener
void removeIndividualStateListener(IndividualStateListener listener)
Removes anIndividualStateListener
that is invoked if the state of anyIndividual
changes. AllIndividual
s created after this method call by thisIndividualFactory
do no longer use the listener.- Parameters:
listener
- the listener that is invoked if the state of any individual changes- See Also:
addIndividualStateListener(org.opt4j.core.IndividualStateListener)
-
-