protected class SimpleGridMinimizer.Solution extends GeneticAlgorithm implements IterativeSolution<Vector>
SimpleGridMinimizer
.Modifier and Type | Field and Description |
---|---|
protected RealScalarFunction |
f |
protected SimpleCellFactory |
factory |
protected double |
fmin |
protected double |
fminLast |
protected Vector[] |
initials |
protected int |
iteration |
protected int |
nNoChanges |
protected Vector |
xmin |
parallel, population, uniform
Modifier | Constructor and Description |
---|---|
protected |
Solution(RealScalarFunction f) |
Modifier and Type | Method and Description |
---|---|
protected List<? extends Chromosome> |
getFirstGeneration()
The initial population is generated by putting a uniform mesh/grid/net over the entire
region.
|
protected boolean |
isConverged()
This genetic algorithm terminates if
the minimum does not improve for a fixed number of iterations, or
the maximum number of iterations is exceeded.
|
ImmutableVector |
minimizer()
Get the minimizer (solution) to the minimization problem.
|
double |
minimum()
Get the (approximate) minimum found.
|
Vector |
search(Vector... initials)
Search for a solution that optimizes the objective function from the
given starting points.
|
void |
setInitials(Vector... initials)
Supply the starting points for the search.
|
Object |
step()
Run a step in genetic algorithm: produce the next generation of chromosome pool.
|
getBest, getChild, getNewPool, getNextGeneration, getOne, nChildren, nPopulation, run
protected Vector[] initials
protected int iteration
protected int nNoChanges
protected double fminLast
protected double fmin
protected Vector xmin
protected final RealScalarFunction f
protected final SimpleCellFactory factory
protected Solution(RealScalarFunction f)
protected List<? extends Chromosome> getFirstGeneration()
getFirstGeneration
in class GeneticAlgorithm
protected boolean isConverged()
isConverged
in class GeneticAlgorithm
true
if a convergence is foundpublic void setInitials(Vector... initials)
IterativeMethod
setInitials
in interface IterativeMethod<Vector>
initials
- the initial guessespublic Object step()
GeneticAlgorithm
step
in interface IterativeMethod<Vector>
step
in class GeneticAlgorithm
public Vector search(Vector... initials)
IterativeMethod
#setInitials(S...)
and then
iteratively IterativeMethod.step()
.
It implements a default convergence criterion.search
in interface IterativeMethod<Vector>
initials
- the initial guessespublic double minimum()
MinimizationSolution
minimum
in interface MinimizationSolution<Vector>
public ImmutableVector minimizer()
MinimizationSolution
minimizer
in interface MinimizationSolution<Vector>
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.