1 package net.sf.openrocket.simulation;
3 import java.util.HashSet;
6 import net.sf.openrocket.aerodynamics.GravityModel;
7 import net.sf.openrocket.aerodynamics.WarningSet;
8 import net.sf.openrocket.aerodynamics.WindSimulator;
9 import net.sf.openrocket.rocketcomponent.Configuration;
10 import net.sf.openrocket.rocketcomponent.RecoveryDevice;
11 import net.sf.openrocket.util.BugException;
12 import net.sf.openrocket.util.Coordinate;
15 public class SimulationStatus implements Cloneable {
17 public SimulationConditions startConditions;
20 public Configuration configuration;
21 public FlightDataBranch flightData;
23 public Coordinate position;
24 public Coordinate velocity;
26 public WindSimulator windSimulator;
27 public GravityModel gravityModel;
29 public double launchRodLength;
32 /** Nanosecond time when the simulation was started. */
33 public long simulationStartTime = Long.MIN_VALUE;
36 /** Set to true when a motor has ignited. */
37 public boolean motorIgnited = false;
39 /** Set to true when the rocket has risen from the ground. */
40 public boolean liftoff = false;
42 /** <code>true</code> while the rocket is on the launch rod. */
43 public boolean launchRod = true;
45 /** Set to true when apogee has been detected. */
46 public boolean apogeeReached = false;
48 /** Contains a list of deployed recovery devices. */
49 public final Set<RecoveryDevice> deployedRecoveryDevices = new HashSet<RecoveryDevice>();
52 public WarningSet warnings;
55 /** Available for special purposes by the listeners. */
56 public Object extra = null;
60 * Returns a (shallow) copy of this object. The general purpose is that the
61 * conditions, flight data etc. point to the same objects. However, subclasses
62 * are allowed to deep-clone specific objects, such as those pertaining to the
63 * current orientation of the rocket.
66 public SimulationStatus clone() {
68 return (SimulationStatus) super.clone();
69 } catch (CloneNotSupportedException e) {
70 throw new BugException("BUG: CloneNotSupportedException?!?",e);