]> git.gag.com Git - debian/openrocket/blob - src/net/sf/openrocket/optimization/general/FunctionOptimizer.java
2caf7fa9cc9c17ca6d4b46a084f8404e3f322442
[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          */
18         public void optimize(Point initial, OptimizationController control);
19         
20         
21         /**
22          * Return the optimum point computed by {@link #optimize(Point, OptimizationController)}.
23          * 
24          * @return      the optimum point value.
25          * @throws IllegalStateException        if {@link #optimize(Point, OptimizationController)} has not been called.
26          */
27         public Point getOptimumPoint();
28         
29         /**
30          * Return the function value at the optimum point.
31          * 
32          * @return      the value at the optimum point.
33          * @throws IllegalStateException        if {@link #optimize(Point, OptimizationController)} has not been called.
34          */
35         public double getOptimumValue();
36         
37         
38         /**
39          * Return the function cache used by this optimization algorithm.
40          * 
41          * @return      the function cache.
42          */
43         public FunctionCache getFunctionCache();
44         
45         /**
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.
49          * 
50          * @param functionCache         the function cache.
51          */
52         public void setFunctionCache(FunctionCache functionCache);
53         
54
55 }