Documentation of 'org.jgap.impl.BestChromosomesSelector' Java class
BestChromosomesSelector
org.jgap.impl

Class BestChromosomesSelector

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Configurable, INaturalSelector, ICloneable


    public class BestChromosomesSelector
    extends NaturalSelectorExt
    implements ICloneable
    Implementation of a NaturalSelector that takes the top n chromosomes into the next generation. n can be specified. Which chromosomes are the best is decided by evaluating their fitness value.
    Since:
    1.1
    See Also:
    Serialized Form
    • Method Detail

      • selectChromosomes

        public void selectChromosomes(int a_howManyToSelect,
                                      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.
        Parameters:
        a_to_pop - the population the chromosomes will be added to
        a_howManyToSelect - the number of chromosomes to select
        Since:
        1.1
      • empty

        public void empty()
        Empties out the working pool of Chromosomes.
        Specified by:
        empty in interface INaturalSelector
        Since:
        1.1
      • returnsUniqueChromosomes

        public boolean returnsUniqueChromosomes()
        Specified by:
        returnsUniqueChromosomes in interface INaturalSelector
        Returns:
        always true as no Chromosome can be returnd multiple times
        Since:
        2.0
      • setOriginalRate

        public void setOriginalRate(double a_originalRate)
        Setting this parameter controls how many chromosomes of the original population will be considered for selection to the next population. If the value is 1 then the whole original population is considered, if it is 0.5 only half of the chromosomes are considered. If doublettes are allowed, then a number of chromosomes missing (number of to be selected minus number selected) will be added.
        Parameters:
        a_originalRate - the rate of how many of the original chromosomes will be selected according to BestChromosomeSelector's strategy. The rest (non-original) of the chromosomes is added as duplicates
        Since:
        2.0
      • getOriginalRate

        public double getOriginalRate()
        Returns:
        see setOriginalRate
        Since:
        2.0
      • equals

        public boolean equals(java.lang.Object a_o)
        Overrides:
        equals in class NaturalSelectorExt
        Parameters:
        a_o - the object to compare
        Returns:
        true: compared object is seen as equal to current instance
      • clone

        public java.lang.Object clone()
        Specified by:
        clone in interface ICloneable
        Overrides:
        clone in class java.lang.Object
        Returns:
        clone of the current object instance

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.