1 package net.sf.openrocket.optimization.rocketoptimization;
3 import net.sf.openrocket.document.Simulation;
4 import net.sf.openrocket.unit.Value;
5 import net.sf.openrocket.util.Pair;
8 * An interface defining a function domain which limits allowed function values.
10 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
12 public interface SimulationDomain {
15 * Return a value determining whether the simulation is within the domain limits
16 * of an optimization process. If the returned value is negative or zero, the
17 * simulation is within the domain; if the value is positive, the returned value
18 * is an indication of how far from the domain the value is; if the returned value
19 * is NaN, the simulation is outside of the domain.
21 * @param simulation the simulation to check.
22 * @return A pair indicating the status. The first element is the reference value,
23 * a negative value or zero if the simulation is in the domain,
24 * a positive value or NaN if not. The second is the value
25 * indication of the domain (may be null).
27 public Pair<Double, Value> getDistanceToDomain(Simulation simulation);