diff --git a/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pdf b/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pdf index c42923a6374716625931eeeaaa9a50b1272e0e8b..099548f8fbe25243c0818c9f302a4c3249983ae6 100644 Binary files a/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pdf and b/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pdf differ diff --git a/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pptx b/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pptx index 303f5debe7d6ba92e0ba0842dc49ff2d2a954c43..7a71a9293078661163f9b2356334622ba81c6533 100644 Binary files a/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pptx and b/conferences/IITSEC2020/IITSEC2020_DIS_Tutorial_20031.pptx differ diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java index 5242ce94c316d1628e76a8530d696d44f217f55d..01a87086023dcf8840f80c020e6217371a46763a 100644 --- a/examples/src/OpenDis7Examples/ExampleSimulationProgram.java +++ b/examples/src/OpenDis7Examples/ExampleSimulationProgram.java @@ -13,6 +13,8 @@ import edu.nps.moves.dis7.pdus.Pdu; import edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface; import edu.nps.moves.dis7.utilities.PduFactory; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; public class ExampleSimulationProgram { @@ -199,14 +201,20 @@ public class ExampleSimulationProgram * Support include DIS EntityStatePdu, FirePdu and CommentPdu all available for * modification and sending in a simulation loop. */ + @SuppressWarnings("SleepWhileInLoop") public void runSimulation () { - final int MAX_LOOP_COUNT = 10; - int loopCount = 0; - VariableRecordType narrativeType = VariableRecordType.OTHER; - boolean simulationComplete = false; // termination condition + try + { + final double LOOP_DURATION_SECONDS = 1.0; // seconds + final int MAX_LOOP_COUNT = 10; + int loopCount = 0; + VariableRecordType narrativeType = VariableRecordType.OTHER; // of potential use + boolean simulationComplete = false; // sentinel variable as termination condition + + // your model setup: who's who in this zoo? + // create PDU objects and set their values - // model setup EntityID entityID_1 = new EntityID(); entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID @@ -221,38 +229,55 @@ public class ExampleSimulationProgram // initialize loop variables loopCount++; - // =============================== - // your own simulation code here! + // ============================================================================================= + // your own simulation code starts here! - // compute a track, update an ESPDU + // compute a track, update an ESPDU, whatever it is that your model is doing... - entityStatePdu.getEntityLocation().setX(entityStatePdu.getEntityLocation().getX() + 1.0); + entityStatePdu.getEntityLocation().setX(entityStatePdu.getEntityLocation().getX() + 1.0); // 1m per timestep // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoort at! - // etc. + // etc. etc. your code goes here + - // your narrative code for CommentPdu here, set all to empty strings to avoid sending + // make your reports: narrative code for CommentPdu here (set all to empty strings to avoid sending) narrativeMessage1 = "MV3500 ExampleSimulationProgram"; narrativeMessage2 = "runSimulation() loop " + loopCount; narrativeMessage3 = ""; // intentionally blank for testing - - // =============================== + // your loop termination condition if (loopCount > 4) // for example { simulationComplete = true; - System.out.println ("*** termination condition met, simulationComplete=" + simulationComplete); - } - // loop now finished so terminate if simulation complete, otherwise send latest PDUs and continue - if (simulationComplete) - break; + } + // your own simulation code is finished here! + // ============================================================================================= + + // keep track of timestep: wait duration for elapsed time in this loop + Thread.sleep((long)(LOOP_DURATION_SECONDS * 1000)); // seconds * (1000 msec/sec) = seconds + System.out.println ("... Pausing for " + LOOP_DURATION_SECONDS + " seconds"); + + // send the status PDUs for this loop and continue System.out.println ("sending PDUs for simulation step " + loopCount + ", monitor loopback to confirm sent"); sendAllPdus(entityStatePdu, firePdu, null, narrativeMessage1, narrativeMessage2, narrativeMessage3); System.out.println ("... PDUs successfully sent"); - } + + // =============================== + // loop now finished, thus terminate if simulation complete, otherwise send latest PDUs and continue + if (simulationComplete || (loopCount > 10000)) // for example; including fail-safe condition is good + { + System.out.println ("... Termination condition met, simulationComplete=" + simulationComplete); + break; + } + } // end of while loop + } + catch (Exception ex) // handle any exception that your code might choose to provoke! + { + Logger.getLogger(ExampleSimulationProgram.class.getName()).log(Level.SEVERE, null, ex); + } } } diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgramOutput.txt b/examples/src/OpenDis7Examples/ExampleSimulationProgramOutput.txt index c0c67435b7d57df71569f9f11553d57f05f5b945..00e0c4cbe566d804449aaeea805249868136ad29 100644 --- a/examples/src/OpenDis7Examples/ExampleSimulationProgramOutput.txt +++ b/examples/src/OpenDis7Examples/ExampleSimulationProgramOutput.txt @@ -10,62 +10,35 @@ compile-single: run-single: [edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] Using network interface Intel(R) Dual Band Wireless-AC 8260 Network confirmation: address=239.1.2.3 port=3000 +... Pausing for 1.0 seconds sending PDUs for simulation step 1, monitor loopback to confirm sent -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 1. received DISPDUType 1 ENTITY_STATE (timestamp 14:23:57, size 144 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 2. received DISPDUType 2 FIRE (timestamp 14:24:01, size 96 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 3. received DISPDUType 22 COMMENT (timestamp 14:28:02, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 1. received DISPDUType 1 ENTITY_STATE (timestamp 05:30:08, size 144 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 2. received DISPDUType 2 FIRE (timestamp 05:30:12, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 3. received DISPDUType 22 COMMENT (timestamp 05:54:12, size 104 bytes) ... PDUs successfully sent +... Pausing for 1.0 seconds sending PDUs for simulation step 2, monitor loopback to confirm sent -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 4. received DISPDUType 1 ENTITY_STATE (timestamp 14:23:57, size 144 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 5. received DISPDUType 2 FIRE (timestamp 14:24:01, size 96 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 6. received DISPDUType 22 COMMENT (timestamp 14:34:06, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 4. received DISPDUType 1 ENTITY_STATE (timestamp 05:30:08, size 144 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 5. received DISPDUType 2 FIRE (timestamp 05:30:12, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 6. received DISPDUType 22 COMMENT (timestamp 06:20:07, size 104 bytes) ... PDUs successfully sent +... Pausing for 1.0 seconds sending PDUs for simulation step 3, monitor loopback to confirm sent -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 7. received DISPDUType 1 ENTITY_STATE (timestamp 14:23:57, size 144 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 8. received DISPDUType 2 FIRE (timestamp 14:24:01, size 96 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 9. received DISPDUType 22 COMMENT (timestamp 14:40:06, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 7. received DISPDUType 1 ENTITY_STATE (timestamp 05:30:08, size 144 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 8. received DISPDUType 2 FIRE (timestamp 05:30:12, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 9. received DISPDUType 22 COMMENT (timestamp 06:46:02, size 104 bytes) ... PDUs successfully sent +... Pausing for 1.0 seconds sending PDUs for simulation step 4, monitor loopback to confirm sent -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 10. received DISPDUType 1 ENTITY_STATE (timestamp 14:23:57, size 144 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 11. received DISPDUType 2 FIRE (timestamp 14:24:01, size 96 bytes) -[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 12. received DISPDUType 22 COMMENT (timestamp 14:46:06, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 10. received DISPDUType 1 ENTITY_STATE (timestamp 05:30:08, size 144 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 11. received DISPDUType 2 FIRE (timestamp 05:30:12, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 12. received DISPDUType 22 COMMENT (timestamp 07:11:55, size 104 bytes) ... PDUs successfully sent -*** termination condition met, simulationComplete=true -BUILD SUCCESSFUL (total time: 3 seconds) - -====================================== -Example output log from AllPduReceiver: - -ant -f C:\\x-nps-gitlab\\NetworkedGraphicsMV3500\\examples -Dnb.internal.action.name=run.single -Djavac.includes=OpenDis7Examples/AllPduReceiver.java -Drun.class=OpenDis7Examples.AllPduReceiver run-single -init: -Deleting: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties -deps-jar: -Updating property file: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\built-jar.properties -Compiling 1 source file to C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\build\classes -warning: [options] bootstrap class path not set in conjunction with -source 8 -Note: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\src\OpenDis7Examples\AllPduReceiver.java uses or overrides a deprecated API. -Note: Recompile with -Xlint:deprecation for details. -Note: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\src\OpenDis7Examples\AllPduReceiver.java uses unchecked or unsafe operations. -Note: Recompile with -Xlint:unchecked for details. -1 warning -compile-single: -run-single: -OpenDis7Examples.AllPduReceiver started... -Usage: AllPduReceiver <multicast group> <port> -Default: AllPduReceiver 239.1.2.3 3000 -14:23:57 received DIS PDU DISPDUType 1 ENTITY_STATE (DISProtocolFamily 1 ENTITY_INFORMATION_INTERACTION) -14:24:01 received DIS PDU DISPDUType 2 FIRE (DISProtocolFamily 2 WARFARE) -14:28:02 received DIS PDU DISPDUType 22 COMMENT (DISProtocolFamily 5 SIMULATION_MANAGEMENT) - messages: "MV3500 ExampleSimulation" "runSimulation loop 1" -14:23:57 received DIS PDU DISPDUType 1 ENTITY_STATE (DISProtocolFamily 1 ENTITY_INFORMATION_INTERACTION) -14:24:01 received DIS PDU DISPDUType 2 FIRE (DISProtocolFamily 2 WARFARE) -14:34:06 received DIS PDU DISPDUType 22 COMMENT (DISProtocolFamily 5 SIMULATION_MANAGEMENT) - messages: "MV3500 ExampleSimulation" "runSimulation loop 2" -14:23:57 received DIS PDU DISPDUType 1 ENTITY_STATE (DISProtocolFamily 1 ENTITY_INFORMATION_INTERACTION) -14:24:01 received DIS PDU DISPDUType 2 FIRE (DISProtocolFamily 2 WARFARE) -14:40:06 received DIS PDU DISPDUType 22 COMMENT (DISProtocolFamily 5 SIMULATION_MANAGEMENT) - messages: "MV3500 ExampleSimulation" "runSimulation loop 3" -14:23:57 received DIS PDU DISPDUType 1 ENTITY_STATE (DISProtocolFamily 1 ENTITY_INFORMATION_INTERACTION) -14:24:01 received DIS PDU DISPDUType 2 FIRE (DISProtocolFamily 2 WARFARE) -14:46:06 received DIS PDU DISPDUType 22 COMMENT (DISProtocolFamily 5 SIMULATION_MANAGEMENT) - messages: "MV3500 ExampleSimulation" "runSimulation loop 4" +... Pausing for 1.0 seconds +sending PDUs for simulation step 5, monitor loopback to confirm sent +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 13. received DISPDUType 1 ENTITY_STATE (timestamp 05:30:08, size 144 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 14. received DISPDUType 2 FIRE (timestamp 05:30:12, size 96 bytes) +[edu.nps.moves.dis7.utilities.DisThreadedNetworkInterface] 15. received DISPDUType 22 COMMENT (timestamp 07:37:49, size 104 bytes) +... PDUs successfully sent +... Termination condition met, simulationComplete=true +BUILD SUCCESSFUL (total time: 8 seconds) diff --git a/presentations/09_HLA_HighLevelArchitecture.pptx b/presentations/09_HLA_HighLevelArchitecture.pptx index f12d1cfa868999d0ed769de2dc83ac2b23d4a1fc..cf4931ba7ec55678d74e3d3a5756dfc6fbb79497 100644 Binary files a/presentations/09_HLA_HighLevelArchitecture.pptx and b/presentations/09_HLA_HighLevelArchitecture.pptx differ diff --git a/specifications/build.xml b/specifications/build.xml index 0b41c4cc267e615963f033243e906355befb17fd..d4910393bb9d6a86598458f76b0e359b21fb62b9 100644 --- a/specifications/build.xml +++ b/specifications/build.xml @@ -26,20 +26,30 @@ <target name="download.IeeeDisStandards.rename" description="rename saved DIS specification files to readable filenames"> <!-- part 1 6387564.pdf --> - <move file="12781-2012.pdf" tofile="IEEE1278.1-2012.DistributedInteractiveSimulation.ApplicationProtocols.12781-2012.pdf" verbose="true" quiet="true" failonerror="false"/> + <move file="12781-2012.pdf" tofile="IEEE1278.1-2012.DistributedInteractiveSimulation.ApplicationProtocols.12781-2012.pdf" verbose="true" quiet="true" failonerror="false"/> + <copy todir="archive" file="IEEE1278.1-2012.DistributedInteractiveSimulation.ApplicationProtocols.12781-2012.pdf" verbose="true" quiet="true" failonerror="false"/> <!-- part 2 7459689.pdf --> - <move file="12782-2015.pdf" tofile="IEEE1278.2-2015.DistributedInteractiveSimulation.CommunicationsServices.12782-2015.pdf" verbose="true" quiet="true" failonerror="false"/> + <move file="12782-2015.pdf" tofile="IEEE1278.2-2015.DistributedInteractiveSimulation.CommunicationsServices.12782-2015.pdf" verbose="true" quiet="true" failonerror="false"/> + <copy todir="archive" file="IEEE1278.2-2015.DistributedInteractiveSimulation.CommunicationsServices.12782-2015.pdf" verbose="true" quiet="true" failonerror="false"/> <!-- part 3 00587529.pdf --> - <move file= "00587529.pdf" tofile="IEEE1278.3-2015.DistributedInteractiveSimulation.CommunicationsServices.00587529.pdf" verbose="true" quiet="true" failonerror="false"/> + <move file= "00587529.pdf" tofile="IEEE1278.3-2015.DistributedInteractiveSimulation.CommunicationsServices.00587529.pdf" verbose="true" quiet="true" failonerror="false"/> + <copy todir="archive" file="IEEE1278.3-2015.DistributedInteractiveSimulation.CommunicationsServices.00587529.pdf" verbose="true" quiet="true" failonerror="false"/> <!-- part 4 6595010.pdf --> - <move file="12784-1997.pdf" tofile="IEEE1278.4-2013.DistributedInteractiveSimulation.VV+A.12784-1997.pdf" verbose="true" quiet="true" failonerror="false"/> + <move file="12784-1997.pdf" tofile="IEEE1278.4-2013.DistributedInteractiveSimulation.VV+A.12784-1997.pdf" verbose="true" quiet="true" failonerror="false"/> + <copy todir="archive" file="IEEE1278.4-2013.DistributedInteractiveSimulation.VV+A.12784-1997.pdf" verbose="true" quiet="true" failonerror="false"/> - <echo message="*.pdf directory contents:"/> + <echo message="check *.pdf directory contents..."/> <!-- https://stackoverflow.com/questions/10528032/listing-all-files-and-subdirectories-using-ant --> <fileset id="dist.contents" dir="." includes="*.pdf"/> <property name="prop.dist.contents" refid="dist.contents"/> <!-- https://stackoverflow.com/questions/7102793/how-to-put-a-newline-in-ant-property --> + <echo message="specifications directory:"/> <echo message="${prop.dist.contents}"/> + <fileset id="archive.contents" dir="archive" includes="*.pdf"/> + <property name="prop.archive.contents" refid="archive.contents"/> + <!-- https://stackoverflow.com/questions/7102793/how-to-put-a-newline-in-ant-property --> + <echo message="specifications/archive directory:"/> + <echo message="${prop.archive.contents}"/> </target> <!-- =============================================== --> @@ -50,8 +60,8 @@ <property name="ieeeBasePageUrl" value="https://ieeexplore.ieee.org/document/"/> <property name="ieeeBaseLinkUrl" value="https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber="/> - <echo message="Warning: due to cookie restrictions, you must download IEEE specifications manually via links found in README.md"/> - <echo message="TODO? University students/faculty can first login with permissions to the IEEE Explore page, then use target download.IeeeDisStandards.retrieve"/> + <echo message="Warning: due to cookie and scripting restrictions, you must download IEEE specifications manually via links found in README.md"/> + <echo message="TODO: university students/faculty can first login with permissions to the IEEE Explore page, then use target download.IeeeDisStandards.retrieve"/> <echo message="IEEE Explore: ${ieeeExploreUrl}"/> <!-- ======================== -->