G - the gene type.N - the BoltzmannSelector requires a number type.public final class BoltzmannSelector<G extends Gene<?,G>,N extends Number & Comparable<? super N>> extends ProbabilitySelector<G,N> implements Immutable
In this Selector, the probability for selection is defined as.
.
| Constructor and Description |
|---|
BoltzmannSelector()
Create a new BoltzmannSelector with a default beta of 0.2.
|
BoltzmannSelector(double b)
Create a new BolzmanSelector with the given b value.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
protected double[] |
probabilities(Population<G,N> population,
int count)
Return an Probability array, which corresponds to the given Population.
|
String |
toString() |
probabilities, selectpublic BoltzmannSelector(double b)
b - the b value of this BolzmanSelectorpublic BoltzmannSelector()
protected double[] probabilities(Population<G,N> population, int count)
ProbabilitySelectorReturn an Probability array, which corresponds to the given Population. The probability array and the population must have the same size. The population is not sorted. If a subclass needs a sorted population, the subclass is responsible to sort the population.
The implementor always assumes that higher fitness values are better. The base class inverts the probabilities (p = 1.0 - p ) if the GA is
supposed to minimize the fitness function.probabilities in class ProbabilitySelector<G extends Gene<?,G>,N extends Number & Comparable<? super N>>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-2013 Franz Wilhelmstötter (2013-12-18 20:17)