diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java index e3bb082c56cd61ddb60dca80a197698962690543..5242ce94c316d1628e76a8530d696d44f217f55d 100644 --- a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java +++ b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java @@ -196,6 +196,8 @@ public class ExampleSimulationProgram /** * User-modifiable method for defining and running a simulation. + * Support include DIS EntityStatePdu, FirePdu and CommentPdu all available for + * modification and sending in a simulation loop. */ public void runSimulation () { @@ -206,7 +208,7 @@ public class ExampleSimulationProgram // model setup EntityID entityID_1 = new EntityID(); - entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); + entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID EntityStatePdu entityStatePdu = pduFactory.makeEntityStatePdu(); entityStatePdu.setEntityID(entityID_1); @@ -222,12 +224,20 @@ public class ExampleSimulationProgram // =============================== // your own simulation code here! + // compute a track, update an ESPDU + + entityStatePdu.getEntityLocation().setX(entityStatePdu.getEntityLocation().getX() + 1.0); + + // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoort at! + + // etc. + // your narrative code for CommentPdu here, set all to empty strings to avoid sending - narrativeMessage1 = "MV3500 ExampleSimulation"; - narrativeMessage2 = "runSimulation loop " + loopCount; + narrativeMessage1 = "MV3500 ExampleSimulationProgram"; + narrativeMessage2 = "runSimulation() loop " + loopCount; narrativeMessage3 = ""; // intentionally blank for testing // ===============================