1 package net.sf.openrocket.optimization.general;
4 * An interface for a function optimization algorithm. The function is evaluated
5 * via a function cache.
7 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
9 public interface FunctionOptimizer {
12 * Perform optimization on the function. The optimization control is called to control
13 * when optimization is stopped.
15 * @param initial the initial start point of the optimization.
16 * @param control the optimization control.
18 public void optimize(Point initial, OptimizationController control);
22 * Return the optimum point computed by {@link #optimize(Point, OptimizationController)}.
24 * @return the optimum point value.
25 * @throws IllegalStateException if {@link #optimize(Point, OptimizationController)} has not been called.
27 public Point getOptimumPoint();
30 * Return the function value at the optimum point.
32 * @return the value at the optimum point.
33 * @throws IllegalStateException if {@link #optimize(Point, OptimizationController)} has not been called.
35 public double getOptimumValue();
39 * Return the function cache used by this optimization algorithm.
41 * @return the function cache.
43 public FunctionCache getFunctionCache();
46 * Set the function cache that provides the function values for this algorithm.
47 * Some algorithms may require the function cache to be an instance of
48 * ParallelFunctionCache.
50 * @param functionCache the function cache.
52 public void setFunctionCache(FunctionCache functionCache);