1 package net.sf.openrocket.optimization.rocketoptimization;
3 import net.sf.openrocket.document.Simulation;
4 import net.sf.openrocket.unit.UnitGroup;
5 import net.sf.openrocket.util.ChangeSource;
8 * An interface what modifies a single parameter in a rocket simulation
9 * based on a double value in the range [0...1].
11 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
13 public interface SimulationModifier extends ChangeSource {
16 * Return a name describing this modifier.
17 * @return a name describing this modifier.
19 public String getName();
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.
27 * @return the object this modifier is related to, or <code>null</code>.
29 public Object getRelatedObject();
33 * Return the current value of the modifier in SI units.
34 * @return the current value of this parameter in SI units.
36 public double getCurrentValue();
40 * Return the minimum value (corresponding to scaled value 0) in SI units.
41 * @return the value corresponding to scaled value 0.
43 public double getMinValue();
46 * Set the minimum value (corresponding to scaled value 0) in SI units.
47 * @param value the value corresponding to scaled value 0.
49 public void setMinValue(double value);
53 * Return the maximum value (corresponding to scaled value 1) in SI units.
54 * @return the value corresponding to scaled value 1.
56 public double getMaxValue();
59 * Set the maximum value (corresponding to scaled value 1) in SI units.
60 * @param value the value corresponding to scaled value 1.
62 public void setMaxValue(double value);
66 * Return the unit group used for the values returned by {@link #getCurrentValue()} etc.
67 * @return the unit group
69 public UnitGroup getUnitGroup();
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.
77 public double getCurrentScaledValue();
82 * Modify the specified simulation to the corresponding parameter value.
84 * @param simulation the simulation to modify
85 * @param scaledValue the scaled value in the range [0...1]
87 public void modify(Simulation simulation, double scaledValue);