Package org.opt4j.core
Interface IndividualFactory
- All Known Implementing Classes:
AbstractIndividualFactory
,DefaultIndividualFactory
,ParticleFactory
public interface IndividualFactory
The
IndividualFactory
is a creator for Individual
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds anIndividualStateListener
to eachIndividual
that is created by this class.create()
Creates a newIndividual
.Creates a newIndividual
with a specifiedGenotype
.void
Removes anIndividualStateListener
that is invoked if the state of anyIndividual
changes.
-
Method Details
-
create
Individual create()Creates a newIndividual
.- Returns:
- the built individual
-
create
Creates a newIndividual
with a specifiedGenotype
.- Parameters:
genotype
- the genotype of the individual- Returns:
- the built individual
-
addIndividualStateListener
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
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:
-