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

Class WeightedRouletteSelector

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


    public class WeightedRouletteSelector
    extends NaturalSelectorExt
    implements ICloneable
    A basic implementation of NaturalSelector that models a roulette wheel. When a Chromosome is added, it gets a number of "slots" on the wheel equal to its fitness value. When the select method is invoked, the wheel is "spun" and the Chromosome occupying the spot on which it lands is selected. Then the wheel is spun again and again until the requested number of Chromosomes have been selected. Since Chromosomes with higher fitness values get more slots on the wheel, there's a higher statistical probability that they'll be chosen, but it's not guaranteed.
    Since:
    1.0
    See Also:
    Serialized Form
    • Method Detail

      • selectChromosomes

        public void selectChromosomes(int a_howManyToSelect,
                                      Population a_to_pop)
        Select a given number of Chromosomes from the pool that will move on to the next generation population. This selection should be guided by the fitness values, but fitness should be treated as a statistical probability of survival, not as the sole determining factor. In other words, Chromosomes with higher fitness values should be more likely to be selected than those with lower fitness values, but it should not be guaranteed.
        Parameters:
        a_howManyToSelect - the number of Chromosomes to select
        a_to_pop - the population the Chromosomes will be added to
        Since:
        1.0
      • empty

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

        public boolean returnsUniqueChromosomes()
        Specified by:
        returnsUniqueChromosomes in interface INaturalSelector
        Returns:
        always false as some Chromosome's could be returnd multiple times
        Since:
        2.0
      • setDoubletteChromosomesAllowed

        public void setDoubletteChromosomesAllowed(boolean a_doublettesAllowed)
        Not supported by this selector! Please do not use it.
        Overrides:
        setDoubletteChromosomesAllowed in class NaturalSelectorExt
        Parameters:
        a_doublettesAllowed - do not use
        Since:
        2.0
      • clone

        public java.lang.Object clone()
        Specified by:
        clone in interface ICloneable
        Overrides:
        clone in class java.lang.Object
        Returns:
        deep clone of this instance
        Since:
        3.2
      • equals

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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.