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.
17 * @throws OptimizationException if an error occurs that prevents optimization
19 public void optimize(Point initial, OptimizationController control) throws OptimizationException;
23 * Return the optimum point computed by {@link #optimize(Point, OptimizationController)}.
25 * @return the optimum point value.
26 * @throws IllegalStateException if {@link #optimize(Point, OptimizationController)} has not been called.
28 public Point getOptimumPoint();
31 * Return the function value at the optimum point.
33 * @return the value at the optimum point.
34 * @throws IllegalStateException if {@link #optimize(Point, OptimizationController)} has not been called.
36 public double getOptimumValue();
40 * Return the function cache used by this optimization algorithm.
42 * @return the function cache.
44 public FunctionCache getFunctionCache();
47 * Set the function cache that provides the function values for this algorithm.
48 * Some algorithms may require the function cache to be an instance of
49 * ParallelFunctionCache.
51 * @param functionCache the function cache.
53 public void setFunctionCache(FunctionCache functionCache);