SafetyMutex and rocket optimization updates
[debian/openrocket] / src / net / sf / openrocket / optimization / general / FunctionOptimizer.java
1 package net.sf.openrocket.optimization.general;
2
3 /**
4  * An interface for a function optimization algorithm.  The function is evaluated
5  * via a function cache.
6  * 
7  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
8  */
9 public interface FunctionOptimizer {
10         
11         /**
12          * Perform optimization on the function.  The optimization control is called to control
13          * when optimization is stopped.
14          * 
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
18          */
19         public void optimize(Point initial, OptimizationController control) throws OptimizationException;
20         
21         
22         /**
23          * Return the optimum point computed by {@link #optimize(Point, OptimizationController)}.
24          * 
25          * @return      the optimum point value.
26          * @throws IllegalStateException        if {@link #optimize(Point, OptimizationController)} has not been called.
27          */
28         public Point getOptimumPoint();
29         
30         /**
31          * Return the function value at the optimum point.
32          * 
33          * @return      the value at the optimum point.
34          * @throws IllegalStateException        if {@link #optimize(Point, OptimizationController)} has not been called.
35          */
36         public double getOptimumValue();
37         
38         
39         /**
40          * Return the function cache used by this optimization algorithm.
41          * 
42          * @return      the function cache.
43          */
44         public FunctionCache getFunctionCache();
45         
46         /**
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.
50          * 
51          * @param functionCache         the function cache.
52          */
53         public void setFunctionCache(FunctionCache functionCache);
54         
55
56 }