bug fixes and rocket optimization
[debian/openrocket] / src / net / sf / openrocket / optimization / rocketoptimization / SimulationDomain.java
1 package net.sf.openrocket.optimization.rocketoptimization;
2
3 import net.sf.openrocket.document.Simulation;
4 import net.sf.openrocket.util.Pair;
5
6 /**
7  * An interface defining a function domain which limits allowed function values.
8  * 
9  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
10  */
11 public interface SimulationDomain {
12         
13         /**
14          * Return a value determining whether the simulation is within the domain limits
15          * of an optimization process.  If the returned value is negative or zero, the
16          * simulation is within the domain; if the value is positive, the returned value
17          * is an indication of how far from the domain the value is; if the returned value
18          * is NaN, the simulation is outside of the domain.
19          * 
20          * @param simulation    the simulation to check.
21          * @return                              the double parameter is the domain indication;
22          *                                              a negative value or zero if the simulation is in the domain,
23          *                                              a positive value or NaN if not.  The second is a human-readable
24          *                                              indication of the domain (may be null).
25          */
26         public Pair<Double, Double> getDistanceToDomain(Simulation simulation);
27         
28 }