create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / optimization / rocketoptimization / OptimizableParameter.java
1 package net.sf.openrocket.optimization.rocketoptimization;
2
3 import net.sf.openrocket.document.Simulation;
4 import net.sf.openrocket.optimization.general.OptimizationException;
5 import net.sf.openrocket.unit.UnitGroup;
6
7 /**
8  * A parameter of a rocket or simulation that can be optimized
9  * (for example max. altitude or velocity).
10  * 
11  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
12  */
13 public interface OptimizableParameter {
14         
15         /**
16          * Return the label name for this optimization parameter.
17          * 
18          * @return      the name for the optimization parameter (e.g. "Flight altitude")
19          */
20         public String getName();
21         
22         /**
23          * Compute the value for this optimization parameter for the simulation.
24          * The return value can be any double value.
25          * <p>
26          * This method can return NaN in case of a problem computing
27          * 
28          * @param simulation    the simulation
29          * @return                              the parameter value (any double value)
30          * @throws OptimizationException        if an error occurs preventing the optimization from continuing
31          */
32         public double computeValue(Simulation simulation) throws OptimizationException, InterruptedException;
33         
34         
35         /**
36          * Return the unit group associated with the computed value.
37          * @return      the unit group of the computed value.
38          */
39         public UnitGroup getUnitGroup();
40         
41 }