org.jgap
Class NaturalSelectorExt
- java.lang.Object
-
- org.jgap.NaturalSelector
-
- org.jgap.NaturalSelectorExt
-
- All Implemented Interfaces:
- java.io.Serializable, Configurable, INaturalSelector
- Direct Known Subclasses:
- BestChromosomesSelector, ThresholdSelector, TournamentSelector, WeightedRouletteSelector
public abstract class NaturalSelectorExt extends NaturalSelector
An extended implementation of NaturalSelector that acts as a base class for the built-in JGAP selectors BestChromosomesSelector and WeightedRouletteSelector.- Since:
- 3.3.3
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgap.NaturalSelector
NaturalSelector.AgeFitnessValueComparator, NaturalSelector.FitnessAgeValueComparator, NaturalSelector.FitnessValueComparator
-
-
Constructor Summary
Constructors Constructor and Description NaturalSelectorExt()Default constructor, only needed for dynamic instantiation!NaturalSelectorExt(Configuration a_config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanequals(java.lang.Object a_o)booleangetDoubletteChromosomesAllowed()voidselect(int a_howManyToSelect, Population a_from_pop, Population a_to_pop)Selects a given number of Chromosomes that will move on to the next generation population.voidsetDoubletteChromosomesAllowed(boolean a_doublettesAllowed)Determines whether doublette chromosomes may be added to the selector or will be ignored.-
Methods inherited from class org.jgap.NaturalSelector
getConfiguration
-
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jgap.INaturalSelector
empty, returnsUniqueChromosomes
-
-
-
-
Constructor Detail
-
NaturalSelectorExt
public NaturalSelectorExt() throws InvalidConfigurationExceptionDefault constructor, only needed for dynamic instantiation!- Throws:
InvalidConfigurationException- Since:
- 3.3.3
-
NaturalSelectorExt
public NaturalSelectorExt(Configuration a_config) throws InvalidConfigurationException
- Parameters:
a_config- the configuration to use- Throws:
InvalidConfigurationException- Since:
- 3.3.3
-
-
Method Detail
-
setDoubletteChromosomesAllowed
public void setDoubletteChromosomesAllowed(boolean a_doublettesAllowed)
Determines whether doublette chromosomes may be added to the selector or will be ignored.- Parameters:
a_doublettesAllowed- true: doublette chromosomes allowed to be added to the selector. false: doublettes will be ignored and not added- Since:
- 3.3.3
-
getDoubletteChromosomesAllowed
public boolean getDoubletteChromosomesAllowed()
- Returns:
- true: doublette chromosomes allowed to be added to the selector false: this is sort of risky and might lead to unexpected population sizes during evolution!
- Since:
- 3.3.3
-
equals
public boolean equals(java.lang.Object a_o)
- Overrides:
equalsin classjava.lang.Object- Parameters:
a_o- the object to compare- Returns:
- true: compared object is seen as equal to current instance
- Since:
- 3.3.3
-
select
public final void select(int a_howManyToSelect, Population a_from_pop, Population a_to_pop)Selects a given number of Chromosomes that will move on to the next generation population.- Parameters:
a_from_pop- the population the Chromosomes will be selected froma_to_pop- the population the Chromosomes will be added toa_howManyToSelect- the number of Chromosomes to select- Since:
- 3.3.3
-
-
DMelt 3.0 © DataMelt by jWork.ORG