Skip to content
Snippets Groups Projects
Commit dbccd4e3 authored by dansl's avatar dansl
Browse files

Merge origin/master

parents 1b65644b 21127f6d
No related branches found
No related tags found
No related merge requests found
Showing
with 560 additions and 299 deletions
# Start, ENCODING_PLAINTEXT, [PduRecorder] 20230605_132110, DIS capture file, .\pduLog\PduCaptureLog4.dislog
# Timestamp(8 bytes),ProtocolVersion,CompatibilityVersion,ExerciseID,PduType,PduStatus,HeaderLength,PduLength,then PDU-specific data
# =============================================
# DisPduType 11 CREATE_ENTITY, Session time 13:21:10.9, session duration 00:00:00.0, Pdu timestamp 1516340589 05:43:09.0, simulation stream interval 0 00:00:00.0
0,0,43,-72,102,70,23,29,7,4,11,5,90,97,-123,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 11 CREATE_ENTITY, Session time 13:21:11.0, session duration 00:00:00.0, Pdu timestamp 1516340589 05:43:09.0, simulation stream interval 0 00:00:00.0
0,0,0,0,0,-95,108,56,7,4,11,5,90,97,-123,109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 22 COMMENT, Session time 13:21:11.0, session duration 00:00:00.0, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,0,-86,-86,-96,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-81,-46,0,0,1,64,83,105,109,117,108,97,116,105,111,110,32,116,105,109,101,115,116,101,112,32,100,117,114,97,116,105,111,110,32,49,46,48,32,115,101,99,111,110,100,115
# DisPduType 22 COMMENT, Session time 13:21:11.0, session duration 00:00:00.1, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,6,111,9,4,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,-53,32,0,0,2,16,83,105,109,117,108,97,116,105,111,110,32,116,105,109,101,32,48,46,48,32,97,116,32,76,111,99,97,108,68,97,116,101,84,105,109,101,32,50,48,50,51,45,48,54,45,48,53,84,49,51,58,50,49,58,49,49,46,48,57,53,57,48,53,50,48,48,0,0,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:12.2, session duration 00:00:01.2, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,72,-31,-56,48,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0
# DisPduType 02 FIRE, Session time 13:21:12.3, session duration 00:00:01.3, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,79,5,-76,-80,7,1,2,2,0,0,0,0,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0
# DisPduType 22 COMMENT, Session time 13:21:12.4, session duration 00:00:01.4, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,85,16,-79,52,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,49,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:12.5, session duration 00:00:01.5, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,91,-46,77,-84,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:13.6, session duration 00:00:02.6, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,-98,-121,6,76,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0
# DisPduType 02 FIRE, Session time 13:21:13.7, session duration 00:00:02.7, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,-92,-102,39,48,7,1,2,2,0,0,0,0,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0
# DisPduType 22 COMMENT, Session time 13:21:13.8, session duration 00:00:02.8, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,-86,-56,78,112,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,50,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:13.9, session duration 00:00:02.9, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,-79,114,-87,-56,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:15.0, session duration 00:00:04.0, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,-12,93,58,100,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0
# DisPduType 02 FIRE, Session time 13:21:15.1, session duration 00:00:04.2, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,0,-6,-24,-10,-84,7,1,2,2,0,0,0,0,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0
# DisPduType 22 COMMENT, Session time 13:21:15.3, session duration 00:00:04.3, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,1,-105,-55,-60,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,51,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:15.4, session duration 00:00:04.4, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,8,73,-44,-80,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:16.5, session duration 00:00:05.5, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,75,11,-112,44,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0
# DisPduType 02 FIRE, Session time 13:21:16.6, session duration 00:00:05.6, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,81,127,92,-72,7,1,2,2,0,0,0,0,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0
# DisPduType 22 COMMENT, Session time 13:21:16.7, session duration 00:00:05.7, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,88,22,2,-64,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,52,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:16.8, session duration 00:00:05.8, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,94,-98,-99,20,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:17.9, session duration 00:00:06.9, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,-96,-78,-80,-76,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,23,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,69,110,116,105,116,121,32,35,53,51,0,0,0,0
# DisPduType 02 FIRE, Session time 13:21:18.0, session duration 00:00:07.1, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,-89,58,31,108,7,1,2,2,0,0,0,0,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,122,0,0
# DisPduType 22 COMMENT, Session time 13:21:18.2, session duration 00:00:07.2, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,-83,-30,23,112,7,1,22,5,0,0,0,0,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,-87,-72,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,3,-87,-72,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,53,0,0
# DisPduType 01 ENTITY_STATE, Session time 13:21:18.3, session duration 00:00:07.3, Pdu timestamp 0 00:00:00.0, simulation stream interval -1516340589 18:16:51.0
0,0,0,1,-76,-59,61,16,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,4,2,0,1,3,0,-51,62,2,2,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,50,0,0,0,0
# DisPduType 22 COMMENT, Session time 13:21:18.4, session duration 00:00:07.4, Pdu timestamp 2556 00:42:36.0, simulation stream interval -1516338033 18:59:27.0
0,0,0,1,-70,-62,-93,116,7,1,22,5,0,0,9,-4,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,9,90,-90,0,0,0,-8,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,0,0,9,90,-90,0,0,1,48,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,99,111,109,112,108,101,116,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,0
# Finish, ENCODING_PLAINTEXT, [PduRecorder] 20230605_132120, DIS capture file, .\pduLog\PduCaptureLog4.dislog
## Homework 3: Example Simulation Recording using OpenDIS Network Streams
// (INSERT DIFFERENCES HERE)
\ No newline at end of file
/**
* Final project assignments supporting the NPS MOVES MV3500 Networked Graphics course.
* Assignment 3 - Example Simulation Program.
*
* @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments">networkedGraphicsMV3500 assignments</a>
* @see java.lang.Package
......
package MV3500Cohort2023MarchJune.homework3.Hedgcorth;
import simkit.SimEntityBase;
import simkit.random.RandomVariate;
/**
* The ArrivalProcess class represents an arrival process using the
* SimEntityBase from simkit.
*
* @author leahhedgcorth
*/
public class ArrivalProcess extends SimEntityBase {
// parameter
private RandomVariate interarrivalTimeGenerator;
// state variable
protected int numberArrivals;
/**
* The constructor method ArrivalProcess(RandomVariate) sets the
* interarrivalTimeGenerator RandomVariate.
*
* @param interarrivalTimeGenerator
*/
public ArrivalProcess(RandomVariate interarrivalTimeGenerator) {
setInterarrivalTimeGenerator(interarrivalTimeGenerator);
}
/**
* The constructor method ArrivalProcess() is currently left empty.
*
*/
public ArrivalProcess() {
}
/**
* The method getInterarrivalTimeGenerator() returns the
* interarrivalTimeGenerator .
*
* @return
*/
public RandomVariate getInterarrivalTimeGenerator() {
return interarrivalTimeGenerator;
}
/**
* The method setInterarrivalTimeGenerator sets the
* interarrivalTimeGenerator.
*
* @param interarrivalTimeGenerator
*/
public void setInterarrivalTimeGenerator(RandomVariate interarrivalTimeGenerator) {
this.interarrivalTimeGenerator = interarrivalTimeGenerator;
}
/**
* The method getNumberArrivals returns the numberArrivals.
*
* @return
*/
public int getNumberArrivals() {
return numberArrivals;
}
/**
* The method reset() sets all state variables to their initial values.
*/
@Override
public void reset() {
super.reset();
numberArrivals = 0;
}
/**
* The doRun() method first fires a PropertyChange and then schedules the
* first Arrival event.
*/
public void doRun() {
firePropertyChange("numberArrivals", getNumberArrivals());
waitDelay("Arrival", interarrivalTimeGenerator);
}
/**
* The doArrival() method saves the oldNumberArrivals and then passes the it to
* the firePropertyChange method to complete the state transition. It also
* increments numberArrivals by 1.
*/
public void doArrival() {
int oldNumberArrivals = getNumberArrivals();
numberArrivals = numberArrivals + 1;
firePropertyChange("numberArrivals", oldNumberArrivals,
getNumberArrivals());
waitDelay("Arrival", interarrivalTimeGenerator);
}
}
......@@ -13,15 +13,22 @@ import edu.nps.moves.dis7.utilities.PduFactory;
import java.time.LocalDateTime;
import java.util.logging.Level;
import java.util.logging.Logger;
import simkit.Schedule;
import simkit.random.RandomVariate;
import simkit.random.RandomVariateFactory;
import simkit.util.SimplePropertyDumper;
/**
* The purpose of this program is to provide an easily modifiable example
* simulation program that includes DIS-capable entities doing tasks and
* reporting them to the network. Default settings include PDU recording turned
* on by default.
*
* @author leahhedgcorth
*/
public class ExampleSimulationProgram {
/* **************************** infrastructure code, modification is seldom needed ************************* */
private String descriptor = this.getClass().getSimpleName();
/**
* DIS channel defined by network address/port combination includes multiple
......@@ -48,7 +55,7 @@ public class ExampleSimulationProgram {
/**
* Maximum number of simulation loops
*/
int MAX_LOOP_COUNT = 4;
int MAX_LOOP_COUNT = 10;
String narrativeMessage1 = new String();
String narrativeMessage2 = new String();
......@@ -216,7 +223,7 @@ public class ExampleSimulationProgram {
@SuppressWarnings("SleepWhileInLoop") // yes we might do that
public void runSimulationLoops() {
try {
final int SIMULATION_MAX_LOOP_COUNT = 10; // be deliberate out there! also avoid infinite loops.
final int SIMULATION_MAX_LOOP_COUNT = 20; // 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?
......@@ -235,6 +242,23 @@ public class ExampleSimulationProgram {
// =============================================================================================
// * your own simulation code starts here! *****************************************************
// =============================================================================================
RandomVariate interarrivalTimeGenerator = RandomVariateFactory.getInstance("Exponential", 3.2);
ArrivalProcess arrivalProcess = new ArrivalProcess(interarrivalTimeGenerator);
SimplePropertyDumper simplePropertyDumper = new SimplePropertyDumper();
arrivalProcess.addPropertyChangeListener(simplePropertyDumper);
System.out.println(arrivalProcess);
Schedule.stopAtTime(15.0);
Schedule.setVerbose(true);
Schedule.reset();
Schedule.startSimulation();
System.out.println("At time " + Schedule.getSimTime() + " there have been " + arrivalProcess.getNumberArrivals() + " arrivals");
// are there any other variables to modify at the beginning of your loop?
// are your reading any DIS PDUs from the network? check for them here
// compute a track, update an ESPDU, whatever it is that your model is doing...
......
This program does something different...
I changed the MAX_LOOP_COUNT value to 10 and changed SIMULATION_LOOP_COUNT value
to 20. I also added code to run the Arrival Process Simulation program and
output the number of arrivals.
/**
* Assignment 3 - Example Simulation Program for MV3500.
* Final project assignments supporting the NPS MOVES MV3500 Networked Graphics course.
*
* @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments">networkedGraphicsMV3500 assignments</a>
* @see java.lang.Package
......
This program sets two entities on a single axis, one friendly and one enemy. The friendly
entity advances towards the enemy with each simulation step and fires munitions when in range.
The simulation length was reduced to three timesteps, stopping on the final timestep needed for the
friendly entity to be within range of engaging the enemy entity.
\ No newline at end of file
# Start, ENCODING_PLAINTEXT, [PduRecorder ExampleSimulationProgramFisher_2 pduRecorder] 20230510_121630, DIS capture file, .\pduLog\PduCaptureLog3.dislog
# Timestamp(8 bytes),ProtocolVersion,CompatibilityVersion,ExerciseID,PduType,PduStatus,HeaderLength,PduLength,then PDU-specific data
# =============================================
# DisPduType 01 ENTITY_STATE, Session time 12:16:30.1, session duration 00:00:00.0, Pdu timestamp 1180032719 18:51:59.0, simulation stream interval 0 00:00:00.0
0,0,40,48,-49,-40,32,-83,7,1,1,1,70,85,-34,-49,0,-112,40,0,0,1,0,2,0,3,1,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 02 FIRE, Session time 12:16:30.2, session duration 00:00:00.0, Pdu timestamp 1180037491 20:11:31.0, simulation stream interval 4772 01:19:32.0
0,0,0,0,5,-89,55,28,7,1,2,2,70,85,-15,115,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,63,-128,0,0,64,-96,0,0,0,0,0,0,68,-69,-128,0
# DisPduType 22 COMMENT, Session time 12:16:30.3, session duration 00:00:00.1, Pdu timestamp 1181481079 13:11:19.0, simulation stream interval 1448360 18:19:20.0
0,0,0,0,11,-24,-11,52,7,1,22,5,70,107,-8,119,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,-81,-46,0,0,1,56,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,70,105,115,104,101,114,95,50,0,0,0,-81,-46,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,49,0,0,0,0,-81,-46,0,0,0,-128,116,104,105,115,32,105,115,32,119,111,114,107,105,110,103,33
# DisPduType 01 ENTITY_STATE, Session time 12:16:30.4, session duration 00:00:00.2, Pdu timestamp 1180033913 19:11:53.0, simulation stream interval 1194 00:19:54.0
0,0,0,0,17,-44,73,-48,7,1,1,1,70,85,-29,121,0,-112,40,0,0,4,0,5,0,6,2,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 12:16:31.5, session duration 00:00:01.4, Pdu timestamp 1180032719 18:51:59.0, simulation stream interval 0 00:00:00.0
0,0,0,0,84,-117,-85,76,7,1,1,1,70,85,-34,-49,0,-112,40,0,0,1,0,2,0,3,1,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 02 FIRE, Session time 12:16:31.6, session duration 00:00:01.5, Pdu timestamp 1180037491 20:11:31.0, simulation stream interval 4772 01:19:32.0
0,0,0,0,90,-69,-125,-64,7,1,2,2,70,85,-15,115,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,63,-128,0,0,64,-96,0,0,0,0,0,0,68,-69,-128,0
# DisPduType 22 COMMENT, Session time 12:16:31.7, session duration 00:00:01.6, Pdu timestamp 1183199065 10:24:25.0, simulation stream interval 3166346 15:32:26.0
0,0,0,0,97,-117,-4,-124,7,1,22,5,70,-122,47,89,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,-81,-46,0,0,1,56,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,70,105,115,104,101,114,95,50,0,0,0,-81,-46,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,50,0,0,0,0,-81,-46,0,0,0,-128,116,104,105,115,32,105,115,32,119,111,114,107,105,110,103,33
# DisPduType 01 ENTITY_STATE, Session time 12:16:31.8, session duration 00:00:01.7, Pdu timestamp 1180033913 19:11:53.0, simulation stream interval 1194 00:19:54.0
0,0,0,0,104,66,-102,-20,7,1,1,1,70,85,-29,121,0,-112,40,0,0,4,0,5,0,6,2,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 12:16:32.9, session duration 00:00:02.8, Pdu timestamp 1180032719 18:51:59.0, simulation stream interval 0 00:00:00.0
0,0,0,0,-86,-99,55,-108,7,1,1,1,70,85,-34,-49,0,-112,40,0,0,1,0,2,0,3,1,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 02 FIRE, Session time 12:16:33.0, session duration 00:00:02.9, Pdu timestamp 1180037491 20:11:31.0, simulation stream interval 4772 01:19:32.0
0,0,0,0,-80,-17,-78,-44,7,1,2,2,70,85,-15,115,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,63,-128,0,0,64,-96,0,0,0,0,0,0,68,-69,-128,0
# DisPduType 22 COMMENT, Session time 12:16:33.1, session duration 00:00:03.0, Pdu timestamp 1184930175 11:16:15.0, simulation stream interval 4897456 16:24:16.0
0,0,0,0,-73,-5,69,72,7,1,22,5,70,-96,-103,127,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,-81,-46,0,0,1,56,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,70,105,115,104,101,114,95,50,0,0,0,-81,-46,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,51,0,0,0,0,-81,-46,0,0,0,-128,116,104,105,115,32,105,115,32,119,111,114,107,105,110,103,33
# DisPduType 01 ENTITY_STATE, Session time 12:16:33.3, session duration 00:00:03.2, Pdu timestamp 1180033913 19:11:53.0, simulation stream interval 1194 00:19:54.0
0,0,0,0,-65,51,-27,84,7,1,1,1,70,85,-29,121,0,-112,40,0,0,4,0,5,0,6,2,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 12:16:34.4, session duration 00:00:04.3, Pdu timestamp 1180032719 18:51:59.0, simulation stream interval 0 00:00:00.0
0,0,0,1,1,-66,6,-44,7,1,1,1,70,85,-34,-49,0,-112,40,0,0,1,0,2,0,3,1,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 02 FIRE, Session time 12:16:34.5, session duration 00:00:04.4, Pdu timestamp 1180037491 20:11:31.0, simulation stream interval 4772 01:19:32.0
0,0,0,1,8,-104,119,-16,7,1,2,2,70,85,-15,115,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,63,-128,0,0,64,-96,0,0,0,0,0,0,68,-69,-128,0
# DisPduType 22 COMMENT, Session time 12:16:34.6, session duration 00:00:04.5, Pdu timestamp 1186667251 13:47:31.0, simulation stream interval 6634532 18:55:32.0
0,0,0,1,14,-62,-64,-112,7,1,22,5,70,-69,26,-13,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,-81,-46,0,0,1,56,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,70,105,115,104,101,114,95,50,0,0,0,-81,-46,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,52,0,0,0,0,-81,-46,0,0,0,-128,116,104,105,115,32,105,115,32,119,111,114,107,105,110,103,33
# DisPduType 01 ENTITY_STATE, Session time 12:16:34.7, session duration 00:00:04.6, Pdu timestamp 1180033913 19:11:53.0, simulation stream interval 1194 00:19:54.0
0,0,0,1,21,89,-34,-24,7,1,1,1,70,85,-29,121,0,-112,40,0,0,4,0,5,0,6,2,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 01 ENTITY_STATE, Session time 12:16:35.8, session duration 00:00:05.7, Pdu timestamp 1180032719 18:51:59.0, simulation stream interval 0 00:00:00.0
0,0,0,1,87,-12,-85,52,7,1,1,1,70,85,-34,-49,0,-112,40,0,0,1,0,2,0,3,1,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 02 FIRE, Session time 12:16:35.9, session duration 00:00:05.8, Pdu timestamp 1180037491 20:11:31.0, simulation stream interval 4772 01:19:32.0
0,0,0,1,94,102,-75,92,7,1,2,2,70,85,-15,115,0,96,40,0,0,2,0,3,0,0,0,2,0,3,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,63,-128,0,0,64,-96,0,0,0,0,0,0,68,-69,-128,0
# DisPduType 22 COMMENT, Session time 12:16:36.1, session duration 00:00:05.9, Pdu timestamp 1188398361 14:39:21.0, simulation stream interval 8365642 19:47:22.0
0,0,0,1,101,65,-61,-128,7,1,22,5,70,-43,-123,25,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,-81,-46,0,0,1,56,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,70,105,115,104,101,114,95,50,0,0,0,-81,-46,0,0,0,-80,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,108,111,111,112,32,53,0,0,0,0,-81,-46,0,0,0,-128,116,104,105,115,32,105,115,32,119,111,114,107,105,110,103,33
# DisPduType 01 ENTITY_STATE, Session time 12:16:36.2, session duration 00:00:06.1, Pdu timestamp 1180033913 19:11:53.0, simulation stream interval 1194 00:19:54.0
0,0,0,1,107,-45,93,88,7,1,1,1,70,85,-29,121,0,-112,40,0,0,4,0,5,0,6,2,0,0,0,0,-31,0,0,0,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 03 DETONATION, Session time 12:16:36.3, session duration 00:00:06.2, Pdu timestamp 1180038685 20:31:25.0, simulation stream interval 5966 01:39:26.0
0,0,0,1,114,44,-7,-104,7,1,3,2,70,85,-10,29,0,104,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,0,30,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# DisPduType 22 COMMENT, Session time 12:16:36.4, session duration 00:00:06.3, Pdu timestamp 1188788487 03:01:27.0, simulation stream interval 8755768 08:09:28.0
0,0,0,1,120,-45,-46,28,7,1,22,5,70,-37,121,7,0,32,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,9,90,-90,0,0,1,56,77,86,51,53,48,48,32,69,120,97,109,112,108,101,83,105,109,117,108,97,116,105,111,110,80,114,111,103,114,97,109,70,105,115,104,101,114,95,50,0,0,9,90,-90,0,0,1,48,114,117,110,83,105,109,117,108,97,116,105,111,110,40,41,32,99,111,109,112,108,101,116,101,100,32,115,117,99,99,101,115,115,102,117,108,108,121,0,0,0,9,90,-90,0,0,0,-128,116,104,105,115,32,105,115,32,119,111,114,107,105,110,103,33
# Finish, ENCODING_PLAINTEXT, [PduRecorder ExampleSimulationProgramFisher_2 pduRecorder] 20230510_121638, DIS capture file, .\pduLog\PduCaptureLog3.dislog
## Homework 3: Example Simulation Recording using OpenDIS Network Streams
Sloan Assignment 3
Changes to the ExampleSimulation.JAVA program:
*Built in a manner to test basic PDU sending processes within a simulation
*Instantiates new Entity's as type Crane for follow on state transitions / updating
*Selects each entity's affiliation as opposing in the simulation
*pulls coordinate values of each entity. As the loop cycles the program begins moving the
relative locations of the entity's in a certain direction of travel
*As the units move in thier given directions of travel the program prints thier
relative location to output.
......@@ -18,3 +18,8 @@ Deliverables:
Please see the [README.md](../../../README.md) in the parent
[assignments](../../../../assignments) directory for detailed instructions.
In class Discussion:
How might PDUs look for a drone swarm?
Two perspectives may be necessary. The first is that each drone is it's own entity, requiring it's own PDU. The second is that the swarm itself is also an entity, and should have a PDU that reflects the group as well.
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment