SafetyMutex and rocket optimization updates
[debian/openrocket] / src / net / sf / openrocket / optimization / rocketoptimization / SimulationModifier.java
1 package net.sf.openrocket.optimization.rocketoptimization;
2
3 import net.sf.openrocket.document.Simulation;
4 import net.sf.openrocket.unit.UnitGroup;
5 import net.sf.openrocket.util.ChangeSource;
6
7 /**
8  * An interface what modifies a single parameter in a rocket simulation
9  * based on a double value in the range [0...1].
10  * 
11  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
12  */
13 public interface SimulationModifier extends ChangeSource {
14         
15         /**
16          * Return a name describing this modifier.
17          * @return      a name describing this modifier.
18          */
19         public String getName();
20         
21         
22         /**
23          * Return the object this modifier is related to.  This is for example the
24          * rocket component this modifier is modifying.  This object can be used by a
25          * UI to group related modifiers.
26          * 
27          * @return      the object this modifier is related to, or <code>null</code>.
28          */
29         public Object getRelatedObject();
30         
31         
32         /**
33          * Return the current value of the modifier in SI units.
34          * @return      the current value of this parameter in SI units.
35          */
36         public double getCurrentValue();
37         
38         
39         /**
40          * Return the minimum value (corresponding to scaled value 0) in SI units.
41          * @return      the value corresponding to scaled value 0.
42          */
43         public double getMinValue();
44         
45         /**
46          * Set the minimum value (corresponding to scaled value 0) in SI units.
47          * @param value the value corresponding to scaled value 0.
48          */
49         public void setMinValue(double value);
50         
51         
52         /**
53          * Return the maximum value (corresponding to scaled value 1) in SI units.
54          * @return      the value corresponding to scaled value 1.
55          */
56         public double getMaxValue();
57         
58         /**
59          * Set the maximum value (corresponding to scaled value 1) in SI units.
60          * @param value the value corresponding to scaled value 1.
61          */
62         public void setMaxValue(double value);
63         
64         
65         /**
66          * Return the unit group used for the values returned by {@link #getCurrentValue()} etc.
67          * @return      the unit group
68          */
69         public UnitGroup getUnitGroup();
70         
71         
72         /**
73          * Return the current scaled value.  This is normally within the range [0...1], but
74          * can be outside the range if the current value is outside of the min and max values.
75          * @return      the current value of this parameter (normally between [0 ... 1])
76          */
77         public double getCurrentScaledValue();
78         
79         
80
81         /**
82          * Modify the specified simulation to the corresponding parameter value.
83          * 
84          * @param simulation    the simulation to modify
85          * @param scaledValue   the scaled value in the range [0...1]
86          */
87         public void modify(Simulation simulation, double scaledValue);
88         
89 }