Package org.opt4j.core
Interface IndividualFactory
-
- All Known Implementing Classes:
AbstractIndividualFactory,DefaultIndividualFactory,ParticleFactory
public interface IndividualFactoryTheIndividualFactoryis a creator forIndividuals.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddIndividualStateListener(IndividualStateListener listener)Adds anIndividualStateListenerto eachIndividualthat is created by this class.Individualcreate()Creates a newIndividual.Individualcreate(Genotype genotype)Creates a newIndividualwith a specifiedGenotype.voidremoveIndividualStateListener(IndividualStateListener listener)Removes anIndividualStateListenerthat is invoked if the state of anyIndividualchanges.
-
-
-
Method Detail
-
create
Individual create()
Creates a newIndividual.- Returns:
- the built individual
-
create
Individual create(Genotype genotype)
Creates a newIndividualwith a specifiedGenotype.- Parameters:
genotype- the genotype of the individual- Returns:
- the built individual
-
addIndividualStateListener
void addIndividualStateListener(IndividualStateListener listener)
Adds anIndividualStateListenerto eachIndividualthat is created by this class. This listener is invoked if the state of theIndividualchanges.- 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 anIndividualStateListenerthat is invoked if the state of anyIndividualchanges. AllIndividuals created after this method call by thisIndividualFactorydo 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)
-
-