From 9c1d39547cae318c7b9e7c60905f661bc1db8428 Mon Sep 17 00:00:00 2001 From: brutzman <brutzman@DESKTOP-2S09UKA> Date: Wed, 2 Sep 2020 11:51:59 -0700 Subject: [PATCH] changes in course presentation --- .../ExampleSimulationProgram.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java index e3bb082c56..5242ce94c3 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 // =============================== -- GitLab