Package io.jenetics
Class StochasticUniversalSelector<G extends Gene<?,G>,N extends Number & Comparable<? super N>>
- java.lang.Object
-
- io.jenetics.ProbabilitySelector<G,N>
-
- io.jenetics.RouletteWheelSelector<G,N>
-
- io.jenetics.StochasticUniversalSelector<G,N>
-
- All Implemented Interfaces:
Selector<G,N>
public class StochasticUniversalSelector<G extends Gene<?,G>,N extends Number & Comparable<? super N>> extends RouletteWheelSelector<G,N>
StochasticUniversalSelector
is a method for selecting a population according to some given probability in a way that minimize chance fluctuations. It can be viewed as a type of roulette game where now we have P equally spaced points which we spin.- Since:
- 1.0
- Version:
- 5.0
- See Also:
- Wikipedia: Stochastic universal sampling
-
-
Field Summary
-
Fields inherited from class io.jenetics.ProbabilitySelector
_reverter, _sorted, POPULATION_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description StochasticUniversalSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISeq<Phenotype<G,N>>
select(Seq<Phenotype<G,N>> population, int count, Optimize opt)
This method sorts the population in descending order while calculating the selection probabilities.String
toString()
-
Methods inherited from class io.jenetics.RouletteWheelSelector
probabilities
-
Methods inherited from class io.jenetics.ProbabilitySelector
probabilities
-
-
-
-
Constructor Detail
-
StochasticUniversalSelector
public StochasticUniversalSelector()
-
-
Method Detail
-
select
public ISeq<Phenotype<G,N>> select(Seq<Phenotype<G,N>> population, int count, Optimize opt)
This method sorts the population in descending order while calculating the selection probabilities.- Specified by:
select
in interfaceSelector<G extends Gene<?,G>,N extends Number & Comparable<? super N>>
- Overrides:
select
in classProbabilitySelector<G extends Gene<?,G>,N extends Number & Comparable<? super N>>
- Parameters:
population
- The population to select from.count
- The number of phenotypes to select.opt
- Determines whether the individuals with higher fitness values or lower fitness values must be selected. This parameter determines whether the GA maximizes or minimizes the fitness function.- Returns:
- The selected phenotypes (a new Population).
-
-