SimplexOptimizer.
AbstractSimplex(double[]) or AbstractSimplex(double[][]).
The other constructor will set all steps
to 1, thus building a default configuration from a unit hypercube.
build method in order
to create the data structure that will be acted on by the other methods of
this class.
SimplexOptimizer
| Modifier and Type | Field and Description |
|---|---|
| private final int | dimension
Simplex dimension (must be equal to |
| private PointValuePair[] | simplex
Simplex. |
| private double[][] | startConfiguration
Start simplex configuration. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | AbstractSimplex(int
Dimension of the simplex. n, double Length of the sides of the hypercube. sideLength)Build a hypercube simplex with the given side length. |
| protected | AbstractSimplex(final double[]
Steps along the canonical axes representing box edges. They
may be negative but not zero. steps)The start configuration for simplex is built from a box parallel to the canonical axes of the space. |
| protected | AbstractSimplex(final double[][]
Reference simplex. referenceSimplex)The real initial simplex will be set up by moving the reference simplex such that its first point is located at the start point of the optimization. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private static double[] | Returns: the steps.Dimension of the hypercube. n, double Length of the sides of the hypercube. sideLength)Create steps for a unit hypercube. |
| public void | evaluate(final MultivariateFunction
Evaluation function. evaluationFunction, final Comparator<PointValuePair> Comparator to use to sort simplex vertices from best to worst. comparator)Evaluate all the non-evaluated points of the simplex. |
| public int | |
| public PointValuePair | Returns: the point at locationindex.Location. index)Get the simplex point stored at the requested |
| public PointValuePair[] | |
| public int | |
| public abstract void | iterate(final MultivariateFunction
Evaluation function. evaluationFunction, final Comparator<PointValuePair> Comparator to use to sort simplex vertices from best
to worst. comparator)Compute the next simplex of the algorithm. |
| protected void | replaceWorstPoint(PointValuePair
Point to insert. pointValuePair, final Comparator<PointValuePair> Comparator to use for sorting the simplex vertices
from best to worst. comparator)Replace the worst point of the simplex by a new point. |
| protected void | |
| protected void |
| dimension | back to summary |
|---|---|
| private final int dimension Simplex dimension (must be equal to | |
| simplex | back to summary |
|---|---|
| private PointValuePair[] simplex Simplex. | |
| startConfiguration | back to summary |
|---|---|
| private double[][] startConfiguration Start simplex configuration. | |
| AbstractSimplex | back to summary |
|---|---|
| protected AbstractSimplex(int n) Build a unit hypercube simplex.
| |
| AbstractSimplex | back to summary |
|---|---|
| protected AbstractSimplex(int n, double sideLength) Build a hypercube simplex with the given side length.
| |
| AbstractSimplex | back to summary |
|---|---|
| protected AbstractSimplex(final double[] steps) The start configuration for simplex is built from a box parallel to the canonical axes of the space. The simplex is the subset of vertices of a box parallel to the canonical axes. It is built as the path followed while traveling from one vertex of the box to the diagonally opposite vertex moving only along the box edges. The first vertex of the box will be located at the start point of the optimization. As an example, in dimension 3 a simplex has 4 vertices. Setting the steps to (1, 10, 2) and the start point to (1, 1, 1) would imply the start simplex would be: { (1, 1, 1), (2, 1, 1), (2, 11, 1), (2, 11, 3) }. The first vertex would be set to the start point at (1, 1, 1) and the last vertex would be set to the diagonally opposite vertex at (2, 11, 3).
| |
| AbstractSimplex | back to summary |
|---|---|
| protected AbstractSimplex(final double[][] referenceSimplex) The real initial simplex will be set up by moving the reference simplex such that its first point is located at the start point of the optimization.
| |
| build | back to summary |
|---|---|
| public void build(final double[] startPoint) Build an initial simplex.
| |
| createHypercubeSteps | back to summary |
|---|---|
| private static double[] createHypercubeSteps(int n, double sideLength) Create steps for a unit hypercube.
| |
| evaluate | back to summary |
|---|---|
| public void evaluate(final MultivariateFunction evaluationFunction, final Comparator<PointValuePair> comparator) Evaluate all the non-evaluated points of the simplex.
| |
| getDimension | back to summary |
|---|---|
| public int getDimension() Get simplex dimension.
| |
| getPoint | back to summary |
|---|---|
| public PointValuePair getPoint(int index) Get the simplex point stored at the requested
| |
| getPoints | back to summary |
|---|---|
| public PointValuePair[] getPoints() Get the points of the simplex.
| |
| getSize | back to summary |
|---|---|
| public int getSize() Get simplex size.
After calling the
| |
| iterate | back to summary |
|---|---|
| public abstract void iterate(final MultivariateFunction evaluationFunction, final Comparator<PointValuePair> comparator) Compute the next simplex of the algorithm.
| |
| replaceWorstPoint | back to summary |
|---|---|
| protected void replaceWorstPoint(PointValuePair pointValuePair, final Comparator<PointValuePair> comparator) Replace the worst point of the simplex by a new point.
| |
| setPoint | back to summary |
|---|---|
| protected void setPoint(int index, PointValuePair point) Store a new point at location
| |
| setPoints | back to summary |
|---|---|
| protected void setPoints(PointValuePair[] points) Replace all points.
Note that no deep-copy of
| |