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.Coordinate;
14 public class SimulationStatus implements Cloneable {
16 public SimulationConditions startConditions;
19 public Configuration configuration;
20 public FlightDataBranch flightData;
22 public Coordinate position;
23 public Coordinate velocity;
25 public WindSimulator windSimulator;
26 public GravityModel gravityModel;
28 public double launchRodLength;
31 /** Nanosecond time when the simulation was started. */
32 public long simulationStartTime = Long.MIN_VALUE;
35 /** Set to true when a motor has ignited. */
36 public boolean motorIgnited = false;
38 /** Set to true when the rocket has risen from the ground. */
39 public boolean liftoff = false;
41 /** <code>true</code> while the rocket is on the launch rod. */
42 public boolean launchRod = true;
44 /** Set to true when apogee has been detected. */
45 public boolean apogeeReached = false;
47 /** Contains a list of deployed recovery devices. */
48 public final Set<RecoveryDevice> deployedRecoveryDevices = new HashSet<RecoveryDevice>();
51 public WarningSet warnings;
54 /** Available for special purposes by the listeners. */
55 public Object extra = null;
59 * Returns a (shallow) copy of this object. The general purpose is that the
60 * conditions, flight data etc. point to the same objects. However, subclasses
61 * are allowed to deep-clone specific objects, such as those pertaining to the
62 * current orientation of the rocket.
65 public SimulationStatus clone() {
67 return (SimulationStatus) super.clone();
68 } catch (CloneNotSupportedException e) {
69 throw new RuntimeException("BUG: CloneNotSupportedException?!?",e);