Package org.opt4j.core
Interface IndividualFactory
- All Known Implementing Classes:
AbstractIndividualFactory,DefaultIndividualFactory,ParticleFactory
public interface IndividualFactory
The
IndividualFactory is a creator for Individuals.-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds anIndividualStateListenerto eachIndividualthat is created by this class.create()Creates a newIndividual.Creates a newIndividualwith a specifiedGenotype.voidRemoves anIndividualStateListenerthat is invoked if the state of anyIndividualchanges.
-
Method Details
-
create
Individual create()Creates a newIndividual.- Returns:
- the built individual
-
create
Creates a newIndividualwith a specifiedGenotype.- Parameters:
genotype- the genotype of the individual- Returns:
- the built individual
-
addIndividualStateListener
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
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:
-