e8506e8d684bb0dc74817a201b8966687ce56be9
[debian/openrocket] / 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
6 /**
7  * A parameter of a rocket or simulation that can be optimized
8  * (for example max. altitude or velocity).
9  * 
10  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
11  */
12 public interface OptimizableParameter {
13         
14         /**
15          * Return the label name for this optimization parameter.
16          * 
17          * @return      the name for the optimization parameter (e.g. "Flight altitude")
18          */
19         public String getName();
20         
21         /**
22          * Compute the value for this optimization parameter for the simulation.
23          * The return value can be any double value.
24          * <p>
25          * This method can return NaN in case of a problem computing
26          * 
27          * @param simulation    the simulation
28          * @return                              the parameter value (any double value)
29          * @throws OptimizationException        if an error occurs preventing the optimization from continuing
30          */
31         public double computeValue(Simulation simulation) throws OptimizationException;
32         
33 }