public final class ExponentialRankSelector<G extends Gene<?,G>,C extends Comparable<? super C>> extends ProbabilitySelector<G,C>
An alternative to the "weak" LinearRankSelector is to assign
survival probabilities to the sorted individuals using an exponential
function.
,
[0..1).
A small value of c increases the probability of the best phenotypes to be selected. If c is set to zero, the selection probability of the best phenotype is set to one. The selection probability of all other phenotypes is zero. A value near one equalizes the selection probabilities.
This selector sorts the population in descending order while calculating the selection probabilities.
| Constructor and Description |
|---|
ExponentialRankSelector()
Create a new selector with default value of 0.975.
|
ExponentialRankSelector(double c)
Create a new exponential rank selector.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
protected double[] |
probabilities(Population<G,C> population,
int count)
This method sorts the population in descending order while calculating the
selection probabilities.
|
String |
toString() |
probabilities, selectpublic ExponentialRankSelector(double c)
c - the c value.IllegalArgumentException - if c is not within the range
[0..1).public ExponentialRankSelector()
protected double[] probabilities(Population<G,C> population, int count)
Population.populationSort() is called
by this method.)probabilities in class ProbabilitySelector<G extends Gene<?,G>,C extends Comparable<? super C>>population - The unsorted population.count - The number of phenotypes to select. This parameter is not
needed for most implementations.population.size() and must sum to
one. The returned value is checked with
assert(Math.abs(math.sum(probabilities) - 1.0) < 0.0001)
in the base class.© 2007-2016 Franz Wilhelmstötter (2016-04-24 10:25)