org.jgap.impl
Class StandardPostSelector
- java.lang.Object
-
- org.jgap.NaturalSelector
-
- org.jgap.impl.StandardPostSelector
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Configurable, INaturalSelector, ICloneable
public class StandardPostSelector extends NaturalSelector implements ICloneable
Implementation of a NaturalSelector that is suited for being processed after genetic operators have been executed. It takes all chromosomes with no fitness value computed to the next generation. Then it takes the top n chromosomes from the remaining input into the next generation. Which chromosomes are the best is decided by evaluating their fitness value.- Since:
- 3.2
- 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 StandardPostSelector()Default constructor.StandardPostSelector(Configuration a_config)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()voidempty()Empties out the working pool of chromosomes.booleanequals(java.lang.Object a_o)booleanreturnsUniqueChromosomes()voidselect(int a_howManyToSelect, Population a_from_pop, Population a_to_pop)Selects a given number of Chromosomes from the pool that will move on to the next generation population.-
Methods inherited from class org.jgap.NaturalSelector
getConfiguration
-
-
-
-
Constructor Detail
-
StandardPostSelector
public StandardPostSelector() throws InvalidConfigurationExceptionDefault constructor.Attention: The configuration used is the one set with the static method Genotype.setConfiguration.
- Throws:
InvalidConfigurationException- Since:
- 3.2
-
StandardPostSelector
public StandardPostSelector(Configuration a_config) throws InvalidConfigurationException
Constructor.- Parameters:
a_config- the configuration to use- Throws:
InvalidConfigurationException- Since:
- 3.2
-
-
Method Detail
-
select
public void select(int a_howManyToSelect, Population a_from_pop, Population a_to_pop)Selects a given number of Chromosomes from the pool that will move on to the next generation population. This selection will be guided by the fitness values. The chromosomes with the best fitness value win.- Specified by:
selectin interfaceINaturalSelector- 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:
- 1.1
-
empty
public void empty()
Empties out the working pool of chromosomes.- Specified by:
emptyin interfaceINaturalSelector- Since:
- 3.2
-
returnsUniqueChromosomes
public boolean returnsUniqueChromosomes()
- Specified by:
returnsUniqueChromosomesin interfaceINaturalSelector- Returns:
- always true as no chromosome can be returnd multiple times
- Since:
- 3.2
-
equals
public boolean equals(java.lang.Object a_o)
- Overrides:
equalsin classjava.lang.Object
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceICloneable- Overrides:
clonein classjava.lang.Object- Returns:
- clone of the current object instance
-
-
DMelt 3.0 © DataMelt by jWork.ORG