G
- the gene typeC
- the fitness function result typepublic static final class EvolutionParams.Builder<G extends Gene<?,G>,C extends Comparable<? super C>> extends Object
Modifier and Type | Method and Description |
---|---|
Alterer<G,C> |
alterer()
Return the used
Alterer of the GA. |
EvolutionParams.Builder<G,C> |
alterers(Alterer<G,C> first,
Alterer<G,C>... rest)
The alterers used for alter the offspring population.
|
EvolutionParams<G,C> |
build()
Builds an new
EvolutionParams instance from the set properties. |
EvolutionParams.Builder<G,C> |
evolutionParams(EvolutionParams<G,C> params) |
long |
maximalPhenotypeAge()
Return the maximal allowed phenotype age.
|
EvolutionParams.Builder<G,C> |
maximalPhenotypeAge(long age)
The maximal allowed age of a phenotype.
|
double |
offspringFraction()
Return the offspring fraction.
|
EvolutionParams.Builder<G,C> |
offspringFraction(double fraction)
The offspring fraction.
|
Selector<G,C> |
offspringSelector()
Return the used offspring
Selector of the GA. |
EvolutionParams.Builder<G,C> |
offspringSelector(Selector<G,C> selector)
The selector used for selecting the offspring population.
|
int |
offspringSize()
Return the number of offspring.
|
int |
populationSize()
Return the number of individuals of a population.
|
EvolutionParams.Builder<G,C> |
populationSize(int size)
The number of individuals which form the population.
|
EvolutionParams.Builder<G,C> |
selector(Selector<G,C> selector)
The selector used for selecting the survivors and offspring
population.
|
Selector<G,C> |
survivorsSelector()
Return the used survivor
Selector of the GA. |
EvolutionParams.Builder<G,C> |
survivorsSelector(Selector<G,C> selector)
The selector used for selecting the survivors population.
|
int |
survivorsSize()
Return the number of survivors.
|
public EvolutionParams.Builder<G,C> evolutionParams(EvolutionParams<G,C> params)
public EvolutionParams.Builder<G,C> offspringSelector(Selector<G,C> selector)
TournamentSelector<>(3)
.selector
- used for selecting the offspring populationthis
builder, for command chainingpublic EvolutionParams.Builder<G,C> survivorsSelector(Selector<G,C> selector)
TournamentSelector<>(3)
.selector
- used for selecting survivors populationthis
builder, for command chainingpublic EvolutionParams.Builder<G,C> selector(Selector<G,C> selector)
TournamentSelector<>(3)
.selector
- used for selecting survivors and offspring populationthis
builder, for command chaining@SafeVarargs public final EvolutionParams.Builder<G,C> alterers(Alterer<G,C> first, Alterer<G,C>... rest)
new SinglePointCrossover<>(0.2)
followed by
new Mutator<>(0.15)
.first
- the first alterer used for alter the offspring
populationrest
- the rest of the alterers used for alter the offspring
populationthis
builder, for command chainingNullPointerException
- if one of the alterers is
null
.public EvolutionParams.Builder<G,C> populationSize(int size)
50
.size
- the number of individuals of a populationthis
builder, for command chainingIllegalArgumentException
- if size < 1
public EvolutionParams.Builder<G,C> offspringFraction(double fraction)
fraction
- the offspring fractionthis
builder, for command chainingIllegalArgumentException
- if the fraction is not within the
range [0, 1].public EvolutionParams.Builder<G,C> maximalPhenotypeAge(long age)
70
.age
- the maximal phenotype agethis
builder, for command chainingIllegalArgumentException
- if age < 1
public EvolutionParams<G,C> build()
EvolutionParams
instance from the set properties.EvolutionParams
instance from the set propertiespublic Alterer<G,C> alterer()
Alterer
of the GA.Alterer
of the GA.public long maximalPhenotypeAge()
public Selector<G,C> offspringSelector()
Selector
of the GA.Selector
of the GA.public Selector<G,C> survivorsSelector()
Selector
of the GA.Selector
of the GA.public int populationSize()
public double offspringFraction()
public int offspringSize()
public int survivorsSize()
© 2007-2020 Franz Wilhelmstötter (2020-02-18 20:01)