diff --git a/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java b/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java index 117dbc67010167a7b4699dfaae44902d6736a16f..d425f779698e62631a7f9d828820caf146ed0ac5 100644 --- a/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java +++ b/examples/src/OpenDis7Examples/ExampleTrackInterpolation.java @@ -51,23 +51,25 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram */ @SuppressWarnings("SleepWhileInLoop") // yes we do that @Override // indicates that this method supercedes corresponding superclass method - public void runSimulationLoops() { - try { + public void runSimulationLoops() + { + try + { final int SIMULATION_MAX_LOOP_COUNT = 50; // be deliberate out there! also avoid infinite loops. int simulationLoopCount = 0; // variable, initialized at 0 boolean simulationComplete = false; // sentinel variable as termination condition, are we done yet? // TODO reset Clock Time to today's date and timestamp to zero, providing consistent outputs for each simulation run simulationTime = initialTime - currentTimeStep; // pre-initialization for first loop + + initializeSimulationEntities(); - // create PDU objects and set their values. - EntityID entityID_1 = new EntityID(); + // use declared PDU objects and set their values. entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID; // TODO someday, use enumerations; is there a unique site triplet for MOVES Institute? pduRecorder.setVerbose(false); - - pduRecorder.hasVerboseOutput(); + pduRecorder.hasVerboseOutput(); // debug check EntityStatePdu espdu_1 = pduFactory.makeEntityStatePdu(); espdu_1.setEntityID(entityID_1);