diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a4fe3c6977171123955ae583411384d21a0bdf93 Binary files /dev/null and b/.DS_Store differ diff --git a/assignments/.DS_Store b/assignments/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a308dd9de4b911c6cf89af7d62423a9a192ba664 Binary files /dev/null and b/assignments/.DS_Store differ diff --git a/assignments/pduLog/README.md b/assignments/pduLog/README.md index 83ba77a6edcaa78b4305bd33c78f85086e1ad954..fa036d159c7bdd833bdf5e92522c0adafab6162d 100644 --- a/assignments/pduLog/README.md +++ b/assignments/pduLog/README.md @@ -2,6 +2,8 @@ This directory holds temporary PDU log files which may be deleted at any time! +To clean out old log files, simply run this directory's **[build.xml](build.xml)** target `clean.all.pduLogs` + Each time you run a DIS simulation and a PduRecorder is listening, another log file is created. File names are numbered sequentially and uniquely, so that important PDU log captures can later be copied and saved to where they are needed. @@ -14,4 +16,4 @@ the corresponding homework or project directory (and likely renaming as well). Note that the PDU log files are very tolerant of inline comments starting with a # character, so you can document success/failure and TODO issues there as well. -To clean out old log files, simply run this directory's **[build.xml](build.xml)** target `clean.all.pduLogs` +<!-- https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/pduLog/README.md --> diff --git a/assignments/src/.DS_Store b/assignments/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..8f370ce20024e01626b607bebd4111933ec46cae Binary files /dev/null and b/assignments/src/.DS_Store differ diff --git a/assignments/src/MV3500Cohort2023MarchJune/.DS_Store b/assignments/src/MV3500Cohort2023MarchJune/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a506183143edd57a28f7eb7f1281d354078197fe Binary files /dev/null and b/assignments/src/MV3500Cohort2023MarchJune/.DS_Store differ diff --git a/assignments/src/MV3500Cohort2023MarchJune/README.md b/assignments/src/MV3500Cohort2023MarchJune/README.md index 31af1645711306afd3112444167369655af6a578..93a113d5abc2ef99f1b06662f7de400cd30814d1 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/README.md +++ b/assignments/src/MV3500Cohort2023MarchJune/README.md @@ -1,5 +1,7 @@ ## Student assignments: homework submission directories +<!-- View this page at https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/src/MV3500Cohort2023MarchJune/README.md --> + * [Homework 1 README](homework1/README.md) Netbeans, Wireshark, Telnet, TCP Sockets * [Homework 2 README](homework2/README.md) UDP Multicast Client/Server Networking * [Homework 3 README](homework3/README.md) Example Simulation Recording OpenDIS Network Streams diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Cecil/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/Cecil/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bbfa3757d6983f7d25567fd7d5d682182499b91f --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Cecil/README.md @@ -0,0 +1,5 @@ +This program does something different... + +This simulation program, beginning at line 220, runs an arrival process. The +ArrivalProcess class extends SimEntityBase in order to conduct a disrete event +simulation of parts arriving to servers. \ No newline at end of file diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Cecil/package-info.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Cecil/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..433d0f6ed5d3a4fd45346176b9737ded3e703846 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Cecil/package-info.java @@ -0,0 +1,10 @@ +/** + * Assignment 3 - Example Simulation Program for MV3500. + * + * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments">networkedGraphicsMV3500 assignments</a> + * @see java.lang.Package + * @see <a href="https://stackoverflow.com/questions/22095487/why-is-package-info-java-useful">StackOverflow: why-is-package-info-java-useful</a> + * @see <a href="https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java">StackOverflow: how-do-i-document-packages-in-java</a> + */ + +package MV3500Cohort2023MarchJune.homework3.Cecil; diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/ExampleSimulationProgram.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/ExampleSimulationProgram.java index 70cf58dc5f1fe865bccca916f6bb16c4eaa8d9e7..8b3bd05a31393d3281e2d1a682bf1fc6d7af64f4 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/ExampleSimulationProgram.java +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/ExampleSimulationProgram.java @@ -1,12 +1,14 @@ /** * Copyright (c) 2008-2021, MOVES Institute, Naval Postgraduate School (NPS). All rights reserved. * This work is provided under a BSD open-source license, see project license.html and license.txt - * - * This Program is a modified version of ExampleSimulationProgram in order to see the + * + * This Program is a modified version of ExampleSimulationProgram in order to see the * verbose plain text pdu log. This simulates a firewall identifying a malicious packet + * and tracing its source before destroying it. + * * and tracing its source before destroying it - updated September 12, 2021 to ensure * correct file pushed to Gitlab. - * + * * @author Bruce Chojnacki */ package MV3500Cohort2023MarchJune.homework3.Chojnacki; @@ -20,19 +22,21 @@ import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; -/** 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. +/** + * 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. */ -public class ExampleSimulationProgram -{ - private boolean verboseComments = true; - static final String NETWORK_ADDRESS_DEFAULT = "239.1.2.3"; - static final int NETWORK_PORT_DEFAULT = 3000; - static String networkAddress = NETWORK_ADDRESS_DEFAULT; - static int networkPort = NETWORK_PORT_DEFAULT; - String DEFAULT_OUTPUT_DIRECTORY = "./pduLog"; - +public class ExampleSimulationProgram { + + private boolean verboseComments = true; + static final String NETWORK_ADDRESS_DEFAULT = "239.1.2.3"; + static final int NETWORK_PORT_DEFAULT = 3000; + static String networkAddress = NETWORK_ADDRESS_DEFAULT; + static int networkPort = NETWORK_PORT_DEFAULT; + String DEFAULT_OUTPUT_DIRECTORY = "./pduLog"; + private EntityID createFriendFireWall() { EntityID FNFireWallID = new EntityID(); // 1.1.225.1.1.1 Platform,Cyber,USA,FireWall FNFireWallID.setSiteID(13); @@ -40,7 +44,7 @@ public class ExampleSimulationProgram FNFireWallID.setEntityID(103); return FNFireWallID; } - + private EntityType createFriendFireWallType() { EntityType FNFireWallType = new EntityType(); FNFireWallType.setEntityKind(EntityKind.PLATFORM); @@ -51,15 +55,15 @@ public class ExampleSimulationProgram FNFireWallType.setSpecific(1); return FNFireWallType; } - - private EntityID createMalPacket() { + + private EntityID createMalPacket() { EntityID MalPacketID = new EntityID(); // 1.1.45.1.7.1 Platform,Cyber,China,MaliciousPacket MalPacketID.setSiteID(66); MalPacketID.setApplicationID(666); MalPacketID.setEntityID(6666); return MalPacketID; } - + private EntityType createMalPacketType() { EntityType MalPacketType = new EntityType(); MalPacketType.setEntityKind(EntityKind.PLATFORM); @@ -70,7 +74,7 @@ public class ExampleSimulationProgram MalPacketType.setSpecific(1); return MalPacketType; } - + private MunitionDescriptor createTraceroute() { EntityType TracerouteType = new EntityType(); //2.2.225.2.13.1 @@ -87,319 +91,307 @@ public class ExampleSimulationProgram Traceroute.setRate(200); return Traceroute; } - + /** - * This runSimulationLoops() method is for you, a - * programmer-modifiable method for defining and running a new simulation of interest. - * Welcome! Other parts of this program handle bookkeeping and plumbing tasks so that - * you can focus on your model entities and activities. - * Expandable support includes DIS EntityStatePdu, FirePdu and CommentPdu all available for - * modification and sending in a simulation loop. - * Continuous improvement efforts seek to make this program as easy and straightforward - * as possible for DIS simulationists to use and adapt. - * All of the other methods are setup, teardown and configuration that you may find - * interesting, even helpful, but don't really have to worry about. + * This runSimulationLoops() method is for you, a programmer-modifiable + * method for defining and running a new simulation of interest. Welcome! + * Other parts of this program handle bookkeeping and plumbing tasks so that + * you can focus on your model entities and activities. Expandable support + * includes DIS EntityStatePdu, FirePdu and CommentPdu all available for + * modification and sending in a simulation loop. Continuous improvement + * efforts seek to make this program as easy and straightforward as possible + * for DIS simulationists to use and adapt. All of the other methods are + * setup, teardown and configuration that you may find interesting, even + * helpful, but don't really have to worry about. */ @SuppressWarnings("SleepWhileInLoop") // yes we do that - public void runSimulationLoops () - { - try - { - /** seconds for real-time execution (not simulation time, which may or may not be the same) */ - final double SIMULATION_LOOP_DURATION_SECONDS = 1.0; - final int SIMULATION_MAX_LOOP_COUNT = 15; // be deliberate out 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? - boolean fireBool = false; - boolean destBool = false; - - // TODO reset clock to zero each time for consistent outputs - - // Your model setup: define participants. who's who in this zoo? - // Assuming you keep track of entity objects... here is some support for for Entity 1. - - // create PDU object for US Firewall and set its values. - //EntityID entityID_1 = new EntityID(); - //entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID; - - EntityStatePdu entityStatePdu_1 = pduFactory.makeEntityStatePdu(); - entityStatePdu_1.setEntityID(createFriendFireWall()); - entityStatePdu_1.setEntityType(createFriendFireWallType()); - entityStatePdu_1.getEntityLocation().setX(0); - entityStatePdu_1.setForceId(ForceID.FRIENDLY); - - // TODO someday, use enumerations; is there a unique site triplet for MOVES Institute? - // create PDU object for Malware Packet and set its values. - //EntityID entityID_2 = new EntityID(); - //entityID_2.setSiteID(4).setApplicationID(5).setEntityID(6); - - EntityStatePdu entityStatePdu_2 = pduFactory.makeEntityStatePdu(); - entityStatePdu_2.setEntityID(createMalPacket()); - entityStatePdu_2.setEntityType(createMalPacketType()); - entityStatePdu_2.getEntityLocation().setX(7); - entityStatePdu_2.setForceId(ForceID.OPPOSING); - - int MalPacketPingsReceived = 0; - - FirePdu firePdu = pduFactory.makeFirePdu(); // for entity 1 first weapon (possible traceroute) - // should we customize this munition? what is it for your simulation? - EntityID fireID = new EntityID(); - fireID.setSiteID(13); - fireID.setApplicationID(43); - fireID.setEntityID(103); - EntityID targetID = new EntityID(); - targetID.setSiteID(66); - targetID.setApplicationID(666); - targetID.setEntityID(6666); - - firePdu.setFiringEntityID(fireID); - firePdu.setTargetEntityID(targetID); - - firePdu.setDescriptor(createTraceroute()); // calling create Traceroute Method - - EntityID TracerouteID = new EntityID(); - TracerouteID.setEntityID(1); - firePdu.setMunitionExpendibleID(TracerouteID); - - CommentReliablePdu MalPacketDestroyedComment = pduFactory.makeCommentReliablePdu("Malware Packet DESTROYED BY Firewall"); - CommentReliablePdu MalPacketDetectedComment = pduFactory.makeCommentReliablePdu("Firewall Detects Malware engage Traceroute"); - - // TODO simulation management PDUs for startup, planning to design special class support - - //DetonationPdu detonationPdu = pduFactory.makeDetonationPdu(); - //detonationPdu.setDescriptor(pDescriptor); - - - // loop the simulation while allowed, programmer can set additional conditions to break out and finish - while (simulationLoopCount < SIMULATION_MAX_LOOP_COUNT) // are we done yet? - { - simulationLoopCount++; // good practice: increment loop counter as first action in that loop - - // ============================================================================================= - // * your own simulation code starts here! * - // ============================================================================================= - - // are there any other variables to modify at the beginning of your loop? - - // compute a track, update an ESPDU, whatever it is that your model is doing... - - // Where is my entity? Insert changes in position; this sample only changes X position. - entityStatePdu_1.getEntityLocation().setX(entityStatePdu_1.getEntityLocation().getX()); // stationary defensive posture - entityStatePdu_2.getEntityLocation().setX(entityStatePdu_2.getEntityLocation().getX() - 1.0); // 1m per timestep - - // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoot at! - Double range = entityStatePdu_2.getEntityLocation().getX(); - System.out.println("range: " + range + " hops from our Network DMZ!"); - - if (range < 5) { // Range 5 - if (!fireBool) { - sendSinglePdu(MalPacketDetectedComment); - } - fireBool = true; - System.out.println("Entity#" + firePdu.getFiringEntityID().getEntityID() + " is firing " + firePdu.getDescriptor().getMunitionType().getDomain() + "." + firePdu.getDescriptor().getMunitionType().getCountry() + "." + firePdu.getDescriptor().getMunitionType().getCategory() + "." + firePdu.getDescriptor().getMunitionType().getSubCategory() + "." + firePdu.getDescriptor().getMunitionType().getSpecific() + "." + " at Entity#" + firePdu.getTargetEntityID().getEntityID()); + public void runSimulationLoops() { + try { + /** + * seconds for real-time execution (not simulation time, which may + * or may not be the same) + */ + final double SIMULATION_LOOP_DURATION_SECONDS = 1.0; + final int SIMULATION_MAX_LOOP_COUNT = 15; // be deliberate out 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? + boolean fireBool = false; + boolean destBool = false; + + // TODO reset clock to zero each time for consistent outputs + // Your model setup: define participants. who's who in this zoo? + // Assuming you keep track of entity objects... here is some support for for Entity 1. + // create PDU object for US Firewall and set its values. + //EntityID entityID_1 = new EntityID(); + //entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID; + EntityStatePdu entityStatePdu_1 = pduFactory.makeEntityStatePdu(); + entityStatePdu_1.setEntityID(createFriendFireWall()); + entityStatePdu_1.setEntityType(createFriendFireWallType()); + entityStatePdu_1.getEntityLocation().setX(0); + entityStatePdu_1.setForceId(ForceID.FRIENDLY); + + // TODO someday, use enumerations; is there a unique site triplet for MOVES Institute? + // create PDU object for Malware Packet and set its values. + //EntityID entityID_2 = new EntityID(); + //entityID_2.setSiteID(4).setApplicationID(5).setEntityID(6); + EntityStatePdu entityStatePdu_2 = pduFactory.makeEntityStatePdu(); + entityStatePdu_2.setEntityID(createMalPacket()); + entityStatePdu_2.setEntityType(createMalPacketType()); + entityStatePdu_2.getEntityLocation().setX(7); + entityStatePdu_2.setForceId(ForceID.OPPOSING); + + int MalPacketPingsReceived = 0; - if (firePdu.getTargetEntityID().getEntityID() == 6666) { - MalPacketPingsReceived += 1; - if (MalPacketPingsReceived > 1) { - // The Firewall destroys the MalPacket + FirePdu firePdu = pduFactory.makeFirePdu(); // for entity 1 first weapon (possible traceroute) + // should we customize this munition? what is it for your simulation? + EntityID fireID = new EntityID(); + fireID.setSiteID(13); + fireID.setApplicationID(43); + fireID.setEntityID(103); + EntityID targetID = new EntityID(); + targetID.setSiteID(66); + targetID.setApplicationID(666); + targetID.setEntityID(6666); - System.out.println("Malware Packet DESTROYED BY Firewall after " + MalPacketPingsReceived + "pings from the traceroute."); - narrativeMessage4 = "Destroyed MalPacket"; - destBool = true; - simulationComplete = true; + firePdu.setFiringEntityID(fireID); + firePdu.setTargetEntityID(targetID); + + firePdu.setDescriptor(createTraceroute()); // calling create Traceroute Method + + EntityID TracerouteID = new EntityID(); + TracerouteID.setEntityID(1); + firePdu.setMunitionExpendibleID(TracerouteID); + + CommentReliablePdu MalPacketDestroyedComment = pduFactory.makeCommentReliablePdu("Malware Packet DESTROYED BY Firewall"); + CommentReliablePdu MalPacketDetectedComment = pduFactory.makeCommentReliablePdu("Firewall Detects Malware engage Traceroute"); + + // TODO simulation management PDUs for startup, planning to design special class support + //DetonationPdu detonationPdu = pduFactory.makeDetonationPdu(); + //detonationPdu.setDescriptor(pDescriptor); + // loop the simulation while allowed, programmer can set additional conditions to break out and finish + while (simulationLoopCount < SIMULATION_MAX_LOOP_COUNT) // are we done yet? + { + simulationLoopCount++; // good practice: increment loop counter as first action in that loop + // ============================================================================================= + // * your own simulation code starts here! * + // ============================================================================================= + // are there any other variables to modify at the beginning of your loop? + // compute a track, update an ESPDU, whatever it is that your model is doing... + // Where is my entity? Insert changes in position; this sample only changes X position. + entityStatePdu_1.getEntityLocation().setX(entityStatePdu_1.getEntityLocation().getX()); // stationary defensive posture + entityStatePdu_2.getEntityLocation().setX(entityStatePdu_2.getEntityLocation().getX() - 1.0); // 1m per timestep + + // decide whether to fire, and then update the firePdu. Hmmm, you might want a target to shoot at! + Double range = entityStatePdu_2.getEntityLocation().getX(); + System.out.println("range: " + range + " hops from our Network DMZ!"); + + if (range < 5) { // Range 5 + if (!fireBool) { + sendSinglePdu(MalPacketDetectedComment); + } + fireBool = true; + System.out.println("Entity#" + firePdu.getFiringEntityID().getEntityID() + " is firing " + firePdu.getDescriptor().getMunitionType().getDomain() + "." + firePdu.getDescriptor().getMunitionType().getCountry() + "." + firePdu.getDescriptor().getMunitionType().getCategory() + "." + firePdu.getDescriptor().getMunitionType().getSubCategory() + "." + firePdu.getDescriptor().getMunitionType().getSpecific() + "." + " at Entity#" + firePdu.getTargetEntityID().getEntityID()); + + if (firePdu.getTargetEntityID().getEntityID() == 6666) { + MalPacketPingsReceived += 1; + if (MalPacketPingsReceived > 1) { + // The Firewall destroys the MalPacket + + System.out.println("Malware Packet DESTROYED BY Firewall after " + MalPacketPingsReceived + "pings from the traceroute."); + narrativeMessage4 = "Destroyed MalPacket"; + destBool = true; + simulationComplete = true; + + } } } - } - // etc. etc. your code goes here for your simulation of interest - - // something happens between my simulation entities, la de da de da... - System.out.println ("Phase complete. Next phase initiating..."); - - - // make your reports: narrative code for CommentPdu here (set all to empty strings to avoid sending) - narrativeMessage1 = "MV3500 Homework 3 - Simulation Program"; - narrativeMessage2 = "runSimulation() loop " + simulationLoopCount; - narrativeMessage3 = "Simulation Started!"; // intentionally blank for testing - - // your loop termination condition goes here - if (simulationLoopCount > 5) // for example - { - simulationComplete = true; - } - // ============================================================================================= - // * your own simulation code is finished here! * - // ============================================================================================= - - // staying synchronized with timestep: wait duration for elapsed time in this loop - // Thread.sleep needs a (long) parameter for milliseconds, which are clumsy to use sometimes - Thread.sleep((long)(SIMULATION_LOOP_DURATION_SECONDS * 1000)); // seconds * (1000 msec/sec) = milliseconds - System.out.println ("... [Pausing for " + SIMULATION_LOOP_DURATION_SECONDS + " seconds]"); - - // OK now send the status PDUs for this loop, and then continue - System.out.println ("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent"); - sendAllPdusForLoopTimestep(entityStatePdu_1, firePdu, timeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); - sendSinglePdu(entityStatePdu_2); // me too i.e. 2! - System.out.println ("... [PDUs successfully sent for this loop]"); - - // =============================== - // loop now finished, check whether to terminate if simulation complete, otherwise continue - if (simulationComplete || (simulationLoopCount > 10000)) // for example; including fail-safe condition is good - { - //sendSinglePdu(detonationPdu); - System.out.println ("... [Termination condition met, simulationComplete=" + simulationComplete + "]"); // ", final loopCount=" + loopCount + - break; - } - } // end of simulation loop - - narrativeMessage2 = "runSimulation() completed successfully"; // all done - sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); - System.out.println ("... [final CommentPdu successfully sent for simulation]"); - // TODO simulation management PDUs - } - catch (InterruptedException iex) // handle any exception that your code might choose to provoke! - { - Logger.getLogger(ExampleSimulationProgram.class.getName()).log(Level.SEVERE, null, iex); - } + // etc. etc. your code goes here for your simulation of interest + + // something happens between my simulation entities, la de da de da... + System.out.println("Phase complete. Next phase initiating..."); + + // make your reports: narrative code for CommentPdu here (set all to empty strings to avoid sending) + narrativeMessage1 = "MV3500 Homework 3 - Simulation Program"; + narrativeMessage2 = "runSimulation() loop " + simulationLoopCount; + narrativeMessage3 = "Simulation Started!"; // intentionally blank for testing + + // your loop termination condition goes here + if (simulationLoopCount > 5) // for example + { + simulationComplete = true; + } + // ============================================================================================= + // * your own simulation code is finished here! * + // ============================================================================================= + + // staying synchronized with timestep: wait duration for elapsed time in this loop + // Thread.sleep needs a (long) parameter for milliseconds, which are clumsy to use sometimes + Thread.sleep((long) (SIMULATION_LOOP_DURATION_SECONDS * 1000)); // seconds * (1000 msec/sec) = milliseconds + System.out.println("... [Pausing for " + SIMULATION_LOOP_DURATION_SECONDS + " seconds]"); + + // OK now send the status PDUs for this loop, and then continue + System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent"); + sendAllPdusForLoopTimestep(entityStatePdu_1, firePdu, timeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); + sendSinglePdu(entityStatePdu_2); // me too i.e. 2! + System.out.println("... [PDUs successfully sent for this loop]"); + + // =============================== + // loop now finished, check whether to terminate if simulation complete, otherwise continue + if (simulationComplete || (simulationLoopCount > 10000)) // for example; including fail-safe condition is good + { + //sendSinglePdu(detonationPdu); + System.out.println("... [Termination condition met, simulationComplete=" + simulationComplete + "]"); // ", final loopCount=" + loopCount + + break; + } + } // end of simulation loop + + narrativeMessage2 = "runSimulation() completed successfully"; // all done + sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); + System.out.println("... [final CommentPdu successfully sent for simulation]"); + // TODO simulation management PDUs + } catch (InterruptedException iex) // handle any exception that your code might choose to provoke! + { + Logger.getLogger(ExampleSimulationProgram.class.getName()).log(Level.SEVERE, null, iex); + } } /* **************************** infrastructure code, modification is seldom needed ************************* */ - + String narrativeMessage1 = new String(); String narrativeMessage2 = new String(); String narrativeMessage3 = new String(); String narrativeMessage4 = new String(); - + /* VariableRecordType enumerations have potential use with CommentPdu logs */ - /* TODO contrast to EntityType */ + /* TODO contrast to EntityType */ VariableRecordType descriptionComment = VariableRecordType.DESCRIPTION; - VariableRecordType narrativeComment = VariableRecordType.COMPLETE_EVENT_REPORT; - VariableRecordType statusComment = VariableRecordType.APPLICATION_STATUS; - VariableRecordType timeStepComment = VariableRecordType.APPLICATION_TIMESTEP; - VariableRecordType otherComment = VariableRecordType.OTHER; - - /** - * Output prefix to identify this class, helps with logging - */ + VariableRecordType narrativeComment = VariableRecordType.COMPLETE_EVENT_REPORT; + VariableRecordType statusComment = VariableRecordType.APPLICATION_STATUS; + VariableRecordType timeStepComment = VariableRecordType.APPLICATION_TIMESTEP; + VariableRecordType otherComment = VariableRecordType.OTHER; + + /** + * Output prefix to identify this class, helps with logging + */ private final static String TRACE_PREFIX = "[" + ExampleSimulationProgram.class.getName() + "] "; - + // class variables - PduFactory pduFactory = new PduFactory(); - DisThreadedNetworkInterface disNetworkInterface; + PduFactory pduFactory = new PduFactory(); + DisThreadedNetworkInterface disNetworkInterface; DisThreadedNetworkInterface.PduListener pduListener; - Pdu receivedPdu; - PduRecorder pduRecorder; - + Pdu receivedPdu; + PduRecorder pduRecorder; + /** - * Constructor design goal: additional built-in initialization conveniences can go here - * to keep student efforts focused on the runSimulation() method. + * Constructor design goal: additional built-in initialization conveniences + * can go here to keep student efforts focused on the runSimulation() + * method. */ - public ExampleSimulationProgram() - { + public ExampleSimulationProgram() { // Constructor is under consideration. Constructor is not currently needed. } - + /** - * Utility Constructor that allows your example simulation program to override default network address and port + * Utility Constructor that allows your example simulation program to + * override default network address and port + * * @param address network address to use * @param port corresponding network port to use */ - public ExampleSimulationProgram(String address, int port) - { + public ExampleSimulationProgram(String address, int port) { setNetworkAddress(address); - + setNetworkPort(port); } /** * get networkAddress + * * @return the networkAddress */ - public String getNetworkAddress() - { + public String getNetworkAddress() { return networkAddress; } /** * set networkAddress + * * @param newNetworkAddress the networkAddress to set */ - public final void setNetworkAddress(String newNetworkAddress) - { + public final void setNetworkAddress(String newNetworkAddress) { ExampleSimulationProgram.networkAddress = newNetworkAddress; } /** * get networkPort + * * @return the networkPort */ - public int getNetworkPort() - { + public int getNetworkPort() { return networkPort; } /** * set networkPort + * * @param newNetworkPort the networkPort to set */ - public final void setNetworkPort(int newNetworkPort) - { + public final void setNetworkPort(int newNetworkPort) { ExampleSimulationProgram.networkPort = newNetworkPort; } /** * Initialize network interface, choosing best available network interface */ - public void setUpNetworkInterface() - { + public void setUpNetworkInterface() { disNetworkInterface = new DisThreadedNetworkInterface(getNetworkAddress(), getNetworkPort()); - disNetworkInterface.setDescriptor ("ExampleSimulationProgramAllen_3 pdu looping"); - - System.out.println("Network confirmation:" + - " address=" + disNetworkInterface.getAddress()+ // disNetworkInterface.getMulticastGroup() + - " port=" + disNetworkInterface.getPort()); // + disNetworkInterface.getDisPort()); - pduListener = new DisThreadedNetworkInterface.PduListener() - { - /** Callback handler for listener */ + disNetworkInterface.setDescriptor("ExampleSimulationProgramAllen_3 pdu looping"); + + System.out.println("Network confirmation:" + + " address=" + disNetworkInterface.getAddress() + + // disNetworkInterface.getMulticastGroup() + + " port=" + disNetworkInterface.getPort()); // + disNetworkInterface.getDisPort()); + pduListener = new DisThreadedNetworkInterface.PduListener() { + /** + * Callback handler for listener + */ @Override - public void incomingPdu(Pdu newPdu) - { + public void incomingPdu(Pdu newPdu) { receivedPdu = newPdu; } }; disNetworkInterface.addListener(pduListener); - + String outputDirectory = DEFAULT_OUTPUT_DIRECTORY; System.out.println("Beginning pdu save to directory " + outputDirectory); pduRecorder = new PduRecorder(outputDirectory, getNetworkAddress(), getNetworkPort()); // assumes save - pduRecorder.setDescriptor ("ExampleSimulationProgramAllen_3 pduRecorder"); + pduRecorder.setDescriptor("ExampleSimulationProgramAllen_3 pduRecorder"); pduRecorder.start(); // begin running } - /** All done, release network resources */ - public void tearDownNetworkInterface() - { + /** + * All done, release network resources + */ + public void tearDownNetworkInterface() { pduRecorder.stop(); disNetworkInterface.removeListener(pduListener); - + disNetworkInterface.close(); // disNetworkInterface.kill(); // renamed as close(), deprecated // disNetworkInterface = null; // making sure no possibility of zombie process remaining... } - /** + /** * Send a single Protocol Data Unit (PDU) of any type + * * @param pdu the pdu to send */ - private void sendSinglePdu(Pdu pdu) - { - try - { + private void sendSinglePdu(Pdu pdu) { + try { disNetworkInterface.send(pdu); Thread.sleep(100); // TODO consider refactoring the wait logic and moving externally - } - catch (InterruptedException ex) - { + } catch (InterruptedException ex) { System.err.println(this.getClass().getName() + " Error sending PDU: " + ex.getLocalizedMessage()); System.exit(1); } @@ -407,82 +399,91 @@ public class ExampleSimulationProgram /** * Send Comment PDU - * @see <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html">Passing Information to a Method or a Constructor</a> Arbitrary Number of Arguments - * @param commentType enumeration value describing purpose of the narrative comment - * @param comments String array of narrative comments + * + * @see + * <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html">Passing + * Information to a Method or a Constructor</a> Arbitrary Number of + * Arguments + * @param commentType enumeration value describing purpose of the narrative + * comment + * @param comments String array of narrative comments */ public void sendCommentPdu(VariableRecordType commentType, - // vararg... variable-length set of String comments can optionally follow - String... comments) - { - sendAllPdusForLoopTimestep (null, null, commentType, comments); + // vararg... variable-length set of String comments can optionally follow + String... comments) { + sendAllPdusForLoopTimestep(null, null, commentType, comments); } /** - * Send EntityState, Fire, Comment PDUs that got updated for this loop, reflecting state of current simulation timestep. - * @see <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html">Passing Information to a Method or a Constructor</a> Arbitrary Number of Arguments + * Send EntityState, Fire, Comment PDUs that got updated for this loop, + * reflecting state of current simulation timestep. + * + * @see + * <a href="https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html">Passing + * Information to a Method or a Constructor</a> Arbitrary Number of + * Arguments * @param entityStatePdu the ESPDU to send, if any - * @param firePdu the FirePDU to send, if any - * @param commentType enumeration value describing purpose of the narrative comment - * @param comments String array of narrative comments + * @param firePdu the FirePDU to send, if any + * @param commentType enumeration value describing purpose of the narrative + * comment + * @param comments String array of narrative comments */ public void sendAllPdusForLoopTimestep(EntityStatePdu entityStatePdu, - FirePdu firePdu, - VariableRecordType commentType, - // vararg... variable-length set of String comments can optionally follow - String... comments) - { - if (entityStatePdu != null) + FirePdu firePdu, + VariableRecordType commentType, + // vararg... variable-length set of String comments can optionally follow + String... comments) { + if (entityStatePdu != null) { sendSinglePdu(entityStatePdu); - - if (firePdu != null) + } + + if (firePdu != null) { sendSinglePdu(firePdu); // bang - - if ((comments != null) && (comments.length > 0)) - { + } + if ((comments != null) && (comments.length > 0)) { ArrayList<String> newCommentsList = new ArrayList<>(); - for (String comment : comments) - { - if (!comment.isEmpty()) - { + for (String comment : comments) { + if (!comment.isEmpty()) { newCommentsList.add(comment); // OK found something to send } } - if (!newCommentsList.isEmpty()) - { - if (commentType == null) + if (!newCommentsList.isEmpty()) { + if (commentType == null) { commentType = otherComment; // fallback value otherComment - // now build the commentPdu from these string inputs, thus constructing a narrative entry + } // now build the commentPdu from these string inputs, thus constructing a narrative entry CommentPdu commentPdu = pduFactory.makeCommentPdu(commentType, newCommentsList.toArray(new String[0])); // comments); sendSinglePdu(commentPdu); - if (isVerboseComments()) + if (isVerboseComments()) { System.out.println("*** [Narrative comment sent: " + commentType.name() + "] " + newCommentsList.toString()); + } } } } - + /** * Main method is first executed when a program instance is loaded. - * @see <a href="https://docs.oracle.com/javase/tutorial/getStarted/application/index.html">Java Tutorials: A Closer Look at the "Hello World!" Application</a> - * @param args command-line arguments are an array of optional String parameters that are passed from execution environment during invocation + * + * @see + * <a href="https://docs.oracle.com/javase/tutorial/getStarted/application/index.html">Java + * Tutorials: A Closer Look at the "Hello World!" Application</a> + * @param args command-line arguments are an array of optional String + * parameters that are passed from execution environment during invocation */ - public static void main(String[] args) - { + public static void main(String[] args) { System.out.println(TRACE_PREFIX + "started..."); - + ExampleSimulationProgram thisProgram = new ExampleSimulationProgram(); // creates instance - + // initial execution: can handle args array of initialization arguments here - if (args.length == 2) - { - if ((args[0] != null) && !args[0].isEmpty()) + if (args.length == 2) { + if ((args[0] != null) && !args[0].isEmpty()) { thisProgram.setNetworkAddress(args[0]); - - if ((args[1] != null) && !args[1].isEmpty()) + } + + if ((args[1] != null) && !args[1].isEmpty()) { thisProgram.setNetworkPort(Integer.parseInt(args[1])); - } - else if (args.length != 0) - { + } + } else if (args.length != 0) { System.err.println("Usage: " + thisProgram.getClass().getName() + " [address port]"); System.exit(-1); } @@ -490,15 +491,16 @@ public class ExampleSimulationProgram thisProgram.setUpNetworkInterface(); - thisProgram.runSimulationLoops (); // ... your simulation execution code goes in there ... - + thisProgram.runSimulationLoops(); // ... your simulation execution code goes in there ... + thisProgram.tearDownNetworkInterface(); // make sure no processes are left lingering - + System.out.println(TRACE_PREFIX + "complete."); // report successful completion } /** * get whether verbose comments are enabled + * * @return whether verboseComments mode is enabled */ public boolean isVerboseComments() { @@ -507,6 +509,7 @@ public class ExampleSimulationProgram /** * set whether verbose comments are enabled + * * @param newVerboseComments whether verboseComments mode is enabled */ public void setVerboseComments(boolean newVerboseComments) { diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95ac86e805097941523bea9919534d83163da89d --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/README.md @@ -0,0 +1,3 @@ +This Program is a modified version of ExampleSimulationProgram in order to see +the verbose plain text pdu log. This simulates a firewall identifying a +malicious packet and tracing its source before destroying it. diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/package-info.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/package-info.java index 55c5c5ecedd73578c39142d1a9eb3ad3cece9c2e..0268b9b9eba6fc239551ab238a93b73cd182f637 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/package-info.java +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Chojnacki/package-info.java @@ -1,10 +1,7 @@ /** - * Assignment 3 - Example Simulation Program for MV3500. + * Assignment 3 - Example Simulation Program for MV3500 + * * - * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments">networkedGraphicsMV3500 assignments</a> - * @see java.lang.Package - * @see <a href="https://stackoverflow.com/questions/22095487/why-is-package-info-java-useful">StackOverflow: why-is-package-info-java-useful</a> - * @see <a href="https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java">StackOverflow: how-do-i-document-packages-in-java</a> */ package MV3500Cohort2023MarchJune.homework3.Chojnacki; diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ArrivalProcess.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ArrivalProcess.java new file mode 100644 index 0000000000000000000000000000000000000000..e4b55ab972d226f7cea3bb909b5b1e2526757b6d --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ArrivalProcess.java @@ -0,0 +1,97 @@ +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); + + } +} diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ExampleSimulationProgram.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ExampleSimulationProgram.java index 0fb320fec4ab75f4b0864ff06a6c30a7e5d52d47..4424f6e4a77772a106ddf7fb785abcc2839feda1 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ExampleSimulationProgram.java +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/ExampleSimulationProgram.java @@ -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... diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93941d70567ac94cf37c6dd3bc28fa99a6d13bb8 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/README.md @@ -0,0 +1,6 @@ +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. + diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/package-info.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..291e392c4c21d577bb6e3e406bdd97c1932cb8da --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Hedgcorth/package-info.java @@ -0,0 +1,11 @@ +/** + * 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 + * @see <a href="https://stackoverflow.com/questions/22095487/why-is-package-info-java-useful">StackOverflow: why-is-package-info-java-useful</a> + * @see <a href="https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java">StackOverflow: how-do-i-document-packages-in-java</a> + */ + +package MV3500Cohort2023MarchJune.homework3.Hedgcorth; diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Islas/README b/assignments/src/MV3500Cohort2023MarchJune/homework3/Islas/README new file mode 100644 index 0000000000000000000000000000000000000000..e1ebccf7401e8e9aee8b7339d162eedf4d74be1d --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Islas/README @@ -0,0 +1,5 @@ +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 diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ecef7094a83d34343191824315c61b88873017aa --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/README.md @@ -0,0 +1,2 @@ +This Program is a modified version of ExampleSimulationProgram in order to see the +verbose plain text pdu log. This example was used to show PDU traffic. \ No newline at end of file diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/package-info.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/package-info.java index 827fb8cecab04050a26c05a1e42de08dddf697ac..bf4046a5c11eb42607cb8e6642943bd92dff135f 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/package-info.java +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Oblak/package-info.java @@ -1,5 +1,5 @@ /** - * Final project assignments supporting the NPS MOVES MV3500 Networked Graphics course. + * Assignment 3 for NPS MOVES MV3500 Networked Graphics course March-June 2023. * * @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/tree/master/assignments">networkedGraphicsMV3500 assignments</a> * @see java.lang.Package diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/README.md index 195b95c32bf201f62588afda0533d35b0eb02f2b..88106f39870709581429247db4b558804b7aa714 100644 --- a/assignments/src/MV3500Cohort2023MarchJune/homework3/README.md +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/README.md @@ -1,5 +1,7 @@ ## Homework 3: Example Simulation Recording using OpenDIS Network Streams +<!-- Viewable at https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/assignments/src/MV3500Cohort2023MarchJune/homework3/README.md --> + ### Assignment 1. Adapt the functionality for [OpenDIS ExampleSimulationProgram](../../../../examples/src/OpenDis7Examples/ExampleSimulationProgram.java), modifying provided code diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Sloan/PduCaptureLog3.dislog b/assignments/src/MV3500Cohort2023MarchJune/homework3/Sloan/PduCaptureLog3.dislog new file mode 100644 index 0000000000000000000000000000000000000000..b04a0aad96f1aee0de9bc0165c43446395cbca6a --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Sloan/PduCaptureLog3.dislog @@ -0,0 +1,48 @@ +# 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 diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Sloan/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/Sloan/README.md new file mode 100644 index 0000000000000000000000000000000000000000..92a9323f81390081983062a3749602dc80ed824f --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Sloan/README.md @@ -0,0 +1,15 @@ +## 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. + + + diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Tidwell/README.md b/assignments/src/MV3500Cohort2023MarchJune/homework3/Tidwell/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fbb12a9a1e345135b7b239319f6aa34e560cfc0f --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Tidwell/README.md @@ -0,0 +1 @@ +This program does something different... diff --git a/assignments/src/MV3500Cohort2023MarchJune/homework3/Tidwell/package-info.java b/assignments/src/MV3500Cohort2023MarchJune/homework3/Tidwell/package-info.java new file mode 100644 index 0000000000000000000000000000000000000000..091d7b4a9b6a28bfd2b9762078b6de3ed3057f30 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/homework3/Tidwell/package-info.java @@ -0,0 +1,10 @@ +/** + * 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 + * @see <a href="https://stackoverflow.com/questions/22095487/why-is-package-info-java-useful">StackOverflow: why-is-package-info-java-useful</a> + * @see <a href="https://stackoverflow.com/questions/624422/how-do-i-document-packages-in-java">StackOverflow: how-do-i-document-packages-in-java</a> + */ + +package MV3500Cohort2023MarchJune.homework3.Tidwell; diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/.DS_Store b/assignments/src/MV3500Cohort2023MarchJune/projects/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..80878e3412d0634604e7b9926bedb652267797ee Binary files /dev/null and b/assignments/src/MV3500Cohort2023MarchJune/projects/.DS_Store differ diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Customer.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Customer.java new file mode 100644 index 0000000000000000000000000000000000000000..ce0d4e839d272f746531854f46af047095098c47 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Customer.java @@ -0,0 +1,54 @@ +import java.io.*; +import java.net.*; + +public class Client_Customer { + public static void main(String[] args) { + + // TODO - Fill out the following questionairre: + + double averageBeefPurchase = 2; // How many pounds of beef do you typically purchase when you buy groceries? + double averageVariationInBeefPurchase = 0.5; // How much do you typically vary from the above amount (also in pounds)? + + double averagePorkPurchase = 4; // How many pounds of pork do you typically purchase when you buy groceries? + double averageVariationInPorkPurchase = 0.5; // How much do you typically vary from the above amount (also in pounds)? + + double averageChickenPurchase = 6; // How many pounds of chicken do you typically purchase when you buy groceries? + double averageVariationInChickenPurchase = 0.5; // How much do you typically vary from the above amount (also in pounds)? + + double averageEggsPurchase = 2; // How many eggs do you typically purchase when you buy groceries (amount in dozens)? + double averageVariationInEggsPurchase = 0.5; // How much do you typically vary from the above amount (also in dozens)? + + // End of TODO section + + Customer myCustomer = new Customer(averageBeefPurchase, averageVariationInBeefPurchase, averagePorkPurchase, averageVariationInPorkPurchase, averageChickenPurchase, averageVariationInChickenPurchase, averageEggsPurchase, averageVariationInEggsPurchase); + + try { + // Create client socket and connect to the server + Socket clientSocket = new Socket("localhost", 12345); + System.out.println("Connected to server."); + + // Send request to server + PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); + String request = "doTransaction," + myCustomer.getBeefPreference().generate() + "," + myCustomer.getPorkPreference().generate() + "," + myCustomer.getChickenPreference().generate() + "," + myCustomer.getEggsPreference().generate(); + out.println(request); + System.out.println("Sent request to server: " + request); + + // Receive response from server + BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + StringBuilder responseBuilder = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) { + responseBuilder.append(line).append("\n"); + } + String response = responseBuilder.toString(); + System.out.print("Received response from server: " + response); + + // Close connections + in.close(); + out.close(); + clientSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java new file mode 100644 index 0000000000000000000000000000000000000000..f5385a7da7b12daec9698f1ac230642118f27855 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Client_Farm.java @@ -0,0 +1,50 @@ +import java.io.*; +import java.net.*; + +public class Client_Farm { + public static void main(String[] args) { + + // TODO - Fill out the following questionairre: + + int cattleCount = 50; // How many cows are on the farm? + + int pigCount = 50; // How many pigs are on the farm? + + int broilerChickenCount = 300; // How many broiler chickens (think supermarket chickens - they don't lay eggs) are on the farm? + + int layerChickenCount = 500; // How many egg laying chickens are on the farm? + + // End of TODO section + + LivestockRanch myFarm = new LivestockRanch(cattleCount, pigCount, broilerChickenCount, layerChickenCount); + + try { + // Create client socket and connect to the server + Socket clientSocket = new Socket("localhost", 12345); + System.out.println("Connected to server."); + + // Send request to server + PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); + String request = "doResupply," + myFarm.getCattleProcessRate() + "," + myFarm.getPigProcessRate() + "," + myFarm.getChickenProcessRate() + "," + myFarm.getEggLayingRate(); + out.println(request); + System.out.println("Sent request to server: " + request); + + // Receive response from server + BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + StringBuilder responseBuilder = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) { + responseBuilder.append(line).append("\n"); + } + String response = responseBuilder.toString(); + System.out.print("Received response from server: " + response); + + // Close connections + in.close(); + out.close(); + clientSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java new file mode 100644 index 0000000000000000000000000000000000000000..1ae3e48540c630bef80513b18ac5e8b986479bc1 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Customer.java @@ -0,0 +1,56 @@ +import simkit.SimEntityBase; +import simkit.random.RandomVariate; +import simkit.random.RandomVariateFactory; + +public class Customer extends SimEntityBase{ + private RandomVariate beefPreference; + private RandomVariate porkPreference; + private RandomVariate chickenPreference; + private RandomVariate eggsPreference; + + public Customer(double averagePurchaseOfBeef, double beefPlusMinus, double averagePurchaseOfPork, double porkPlusMinus, double averagePurchaseOfChicken, double chickenPlusMinus, double averagePurchaseOfEggs, double eggsPlusMinus) { + this.beefPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfBeef, beefPlusMinus); + this.porkPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfPork, porkPlusMinus); + this.chickenPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfChicken, chickenPlusMinus); + this.eggsPreference = RandomVariateFactory.getInstance("Normal", averagePurchaseOfEggs, eggsPlusMinus); + } + + public void doRun() { + waitDelay("Transaction", 0.0); + } + + public void doTransaction() { + double beef = beefPreference.generate(); + beef = beef < 0 ? 0 : beef; + + double pork = porkPreference.generate(); + pork = pork < 0 ? 0 : pork; + + double chicken = chickenPreference.generate(); + chicken = chicken < 0 ? 0 : chicken; + + double eggs = eggsPreference.generate(); + eggs = eggs < 0 ? 0 : eggs; + + waitDelay("Transaction", 0.0, beef, pork, chicken, eggs); + waitDelay("Transaction", 7.0); + } + + public RandomVariate getBeefPreference() { + return beefPreference; + } + + public RandomVariate getPorkPreference() { + return porkPreference; + } + + public RandomVariate getChickenPreference() { + return chickenPreference; + } + + public RandomVariate getEggsPreference() { + return eggsPreference; + } + + +} diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java new file mode 100644 index 0000000000000000000000000000000000000000..b099bc6bb78dad829f520fdb6c5969fc08b72131 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/FarmStore.java @@ -0,0 +1,69 @@ +import java.text.DecimalFormat; + +public class FarmStore { + private double bankAccount; + private double BEEFCOST = 10; // Cost per pound + private double PORKCOST = 5; // Cost per pound + private double CHICKENCOST = 2; // Cost per pound + private double EGGSCOST = 2; // Cost per dozen + + protected double beefQuantity; // Quantity in pounds + protected double porkQuantity; // Quantity in pounds + protected double chickenQuantity; // Quantity in pounds + protected double eggQuantity; // Quantity in dozens + + public FarmStore() { + this.bankAccount = 0; + this.beefQuantity = 0; + this.porkQuantity = 0; + this.chickenQuantity = 0; + this.eggQuantity = 0; + } + + public String doTransaction(double beef, double pork, double chicken, double eggs) { + DecimalFormat df = new DecimalFormat("#.##"); + + if (this.beefQuantity < beef) { + beef = Math.max(this.beefQuantity, 0); + System.out.println("We are out of beef"); + } + else {beef = Double.parseDouble(df.format(beef));} + if (this.porkQuantity < pork) { + pork = Math.max(this.porkQuantity, 0); + System.out.println("We are out of pork"); + } + else {pork = Double.parseDouble(df.format(pork));} + if (this.chickenQuantity < chicken) { + chicken = Math.max(this.chickenQuantity, 0); + System.out.println("We are out of chicken"); + } + else {chicken = Double.parseDouble(df.format(chicken));} + if (this.eggQuantity < eggs) { + eggs = Math.max(this.eggQuantity, 0); + System.out.println("We are out of eggs"); + } + else {eggs = Double.parseDouble(df.format(eggs));} + + this.beefQuantity -= beef; + this.porkQuantity -= pork; + this.chickenQuantity -= chicken; + this.eggQuantity -= eggs; + + double cost = beef * BEEFCOST + pork * PORKCOST + chicken * CHICKENCOST + eggs * EGGSCOST; + cost = Double.parseDouble(df.format(cost)); + this.bankAccount += cost; + + return "Product purchased:\nBeef: " + beef + " lbs\nPork: " + pork + " lbs\nChicken: " + chicken + " lbs\nEggs: " + eggs + " dozen\nTransaction total: $" + cost; + } + + public String doResupply(double beef, double pork, double chicken, double eggs) { + this.beefQuantity += beef; + this.porkQuantity += pork; + this.chickenQuantity += chicken; + this.eggQuantity += eggs; + + return "Product received:\nBeef: " + beef + " lbs\t\tCurrent Stock: " + beefQuantity + " lbs\nPork: " + pork + + " lbs\tCurrent Stock: " + porkQuantity + " lbs\nChicken: " + chicken + " lbs\tCurrent Stock: " + chickenQuantity + + " lbs\nEggs: " + eggs + " dozen\tCurrent Stock: " + eggQuantity + " dozen\nCurrent Profit: $" + bankAccount; + } +} \ No newline at end of file diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java new file mode 100644 index 0000000000000000000000000000000000000000..5db0ee64982065b596cd7d7c162cd2c8e8948925 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/LivestockRanch.java @@ -0,0 +1,57 @@ +public class LivestockRanch { + private int totalCattle; + private int totalPigs; + private int totalBroilerChickens; + private int totalLayerChickens; + + private double cattleProcessRate; + private double pigProcessRate; + private double chickenProcessRate; + private double eggLayingRate; + + public LivestockRanch (int totalCattle, int totalPigs, int totalBroilerChickens, int totalLayerChickens) { + this.totalCattle = totalCattle; + this.totalPigs = totalPigs; + this.totalBroilerChickens = totalBroilerChickens; + this.totalLayerChickens = totalLayerChickens; + + this.cattleProcessRate = totalCattle * 500 / (3 * 12); // Processing 1/3 of the total population per year, 1 per month, at 500 lbs of beef per cow + this.pigProcessRate = totalPigs * 150 / 6; // Processing 1/6 of the total population per month, at 150 lbs of pork per pig + this.chickenProcessRate = totalBroilerChickens * 6 / 3; // Processing 1/3 of the total population per month, at 6 lbs per chicken + this.eggLayingRate = totalLayerChickens * (25 / 12); // 25 eggs per layer chicken (divided by 12 to be sold in dozens) + } + + public int getTotalCattle() { + return totalCattle; + } + + public int getTotalPigs() { + return totalPigs; + } + + public int getTotalBroilerChickens() { + return totalBroilerChickens; + } + + public int getTotalLayerChickens() { + return totalLayerChickens; + } + + public double getCattleProcessRate() { + return cattleProcessRate; + } + + public double getPigProcessRate() { + return pigProcessRate; + } + + public double getChickenProcessRate() { + return chickenProcessRate; + } + + public double getEggLayingRate() { + return eggLayingRate; + } + + +} diff --git a/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Server.java b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Server.java new file mode 100644 index 0000000000000000000000000000000000000000..ed276501a874c6af3d96562e835e503c12e6faa7 --- /dev/null +++ b/assignments/src/MV3500Cohort2023MarchJune/projects/Islas/Server.java @@ -0,0 +1,72 @@ +import java.io.*; +import java.net.*; + +public class Server { + public static void main(String[] args) { + + FarmStore market = new FarmStore(); + try { + // Create server socket + ServerSocket serverSocket = new ServerSocket(12345); + System.out.println("Server listening on port 12345..."); + + while (true) { + // Accept client connection + Socket clientSocket = serverSocket.accept(); + System.out.println("Client connected: " + clientSocket.getInetAddress().getHostAddress()); + + // Start a new thread to handle the client connection + ClientHandler clientHandler = new ClientHandler(clientSocket, market); + clientHandler.start(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + static class ClientHandler extends Thread { + private Socket clientSocket; + private FarmStore market; + + public ClientHandler(Socket socket, FarmStore market) { + this.clientSocket = socket; + this.market = market; + } + + public void run() { + try { + // Read data from client + BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); + String request = in.readLine(); + String[] parsedRequest = request.split(","); + System.out.println("Received request from client: " + request); + + // Process request + String response = processRequest(parsedRequest[0], Double.parseDouble(parsedRequest[1]), Double.parseDouble(parsedRequest[2]), Double.parseDouble(parsedRequest[3]), Double.parseDouble(parsedRequest[4])); + System.out.print("Sending response to client: " + response); + + // Send response to client + PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true); + out.println(response); + + // Close connections + in.close(); + out.close(); + clientSocket.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private String processRequest(String request, double beef, double pork, double chicken, double eggs) { + // Process the request and execute the corresponding method + if (request.equals("doTransaction")) { + return market.doTransaction(beef, pork, chicken, eggs); // Assuming appropriate arguments for the method + } else if (request.equals("doResupply")) { + return market.doResupply(beef, pork, chicken, eggs); + } else { + return "Invalid request!"; + } + } + } +} diff --git a/examples/pduLog/ExamplePduCaptureLog.dislog b/examples/pduLog/ExamplePduCaptureLog.dislog new file mode 100644 index 0000000000000000000000000000000000000000..6efef559a8fd6e4eb14823e1d56311d70819036d --- /dev/null +++ b/examples/pduLog/ExamplePduCaptureLog.dislog @@ -0,0 +1,54 @@ +# Start, ENCODING_PLAINTEXT, [PduRecorder] 20230604_183013, DIS capture file, .\pduLog\PduCaptureLog.dislog +# Timestamp(8 bytes),ProtocolVersion,CompatibilityVersion,ExerciseID,PduType,PduStatus,HeaderLength,PduLength,then PDU-specific data +# ============================================= +# DisPduType 11 CREATE_ENTITY, Session time 18:30:13.5, session duration 00:00:00.0, Pdu timestamp -2131319063 22:55:37.0, simulation stream interval 0 00:00:00.0 +0,0,60,-107,-83,78,20,41,7,4,11,5,-128,-10,-90,-23,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 18:30:13.5, session duration 00:00:00.0, Pdu timestamp -2131319063 22:55:37.0, simulation stream interval 0 00:00:00.0 +0,0,0,0,1,-64,110,112,7,4,11,5,-128,-10,-90,-23,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 18:30:13.5, session duration 00:00:00.0, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,1,-58,-69,-72,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 18:30:13.6, session duration 00:00:00.1, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,6,-108,-17,92,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,52,84,49,56,58,51,48,58,49,51,46,54,54,50,50,56,53,54,48,48,0,0,0,0,0,0 +# DisPduType 01 ENTITY_STATE, Session time 18:30:14.7, session duration 00:00:01.2, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,73,86,-81,-20,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,4,17,12,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 18:30:14.8, session duration 00:00:01.3, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,79,-14,69,60,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 18:30:15.0, session duration 00:00:01.4, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,86,70,-14,-104,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 18:30:15.1, session duration 00:00:01.5, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,93,21,15,116,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 18:30:16.2, session duration 00:00:02.6, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,-97,54,-55,56,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,4,17,12,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 18:30:16.3, session duration 00:00:02.7, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,-91,-105,-87,-96,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 18:30:16.4, session duration 00:00:02.8, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,-84,33,1,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,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 18:30:16.5, session duration 00:00:03.0, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,-77,10,-64,24,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 18:30:17.6, session duration 00:00:04.1, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,-11,40,-96,80,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,4,17,12,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 18:30:17.7, session duration 00:00:04.2, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,0,-5,100,-125,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 18:30:17.8, session duration 00:00:04.3, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,1,-72,-80,108,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 18:30:17.9, session duration 00:00:04.4, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,7,-66,-30,96,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 18:30:19.0, session duration 00:00:05.5, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,74,47,123,-16,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,4,17,12,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 18:30:19.1, session duration 00:00:05.6, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,80,75,63,-60,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 18:30:19.3, session duration 00:00:05.7, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,86,-74,-12,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,52,0,0 +# DisPduType 01 ENTITY_STATE, Session time 18:30:19.4, session duration 00:00:05.8, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,94,78,-15,96,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 18:30:20.5, session duration 00:00:06.9, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,-96,68,-75,-96,7,1,1,1,0,0,0,0,0,-112,40,0,0,1,0,2,0,3,1,0,1,2,0,-31,4,17,12,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 18:30:20.6, session duration 00:00:07.0, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,-90,-12,29,-116,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 18:30:20.7, session duration 00:00:07.2, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,-83,104,49,-108,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 18:30:20.8, session duration 00:00:07.3, Pdu timestamp 0 00:00:00.0, simulation stream interval 2131319063 01:04:23.0 +0,0,0,1,-77,-11,-11,-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 22 COMMENT, Session time 18:30:20.9, session duration 00:00:07.4, Pdu timestamp -3558 23:00:42.0, simulation stream interval 2131315505 00:05:05.0 +0,0,0,1,-70,30,81,112,7,1,22,5,-1,-1,-14,26,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] 20230604_183023, DIS capture file, .\pduLog\PduCaptureLog.dislog diff --git a/examples/pduLog/README.md b/examples/pduLog/README.md index 1e83f1026e5ecd9e83514af7eafd8f5f3d91b6e1..5e90628af63f87d6b42c39bb8cd82b5abc5113fc 100644 --- a/examples/pduLog/README.md +++ b/examples/pduLog/README.md @@ -2,6 +2,8 @@ This directory holds temporary PDU log files which may be deleted at any time! +To clean out old log files, simply run [build.xml](build.xml) target `clean.all.log.files` + Each time you run a DIS simulation and a PduRecorder is listening, another log file is created. File names are numbered sequentially and uniquely, so that important PDU log captures can later be copied and saved to where they are needed. @@ -14,4 +16,4 @@ the corresponding homework or project directory (and likely renaming as well). Note that the PDU log files are very tolerant of inline comments starting with a # character, so you can document success/failure and TODO issues there as well. -To clean out old log files, simply run [build.xml](build.xml) target `clean.all.log.files` +<!-- https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/pduLog/README.md --> diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.png b/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.png new file mode 100644 index 0000000000000000000000000000000000000000..1917aa4ef9e4a994d8b4057c7c033f2ab73b78a6 Binary files /dev/null and b/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.png differ diff --git a/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.vsdx b/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.vsdx index dd9909acc73b3f6ec98f3a24550ddbe423a59867..439a854c826923f7f83f705be0a76139f141d2af 100644 Binary files a/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.vsdx and b/examples/src/OpenDis7Examples/ExampleSimulationProgramFlowDiagram.vsdx differ diff --git a/presentations/09_HLA_HighLevelArchitecture.pptx b/presentations/09_HLA_HighLevelArchitecture.pptx index bc476c04917bfdeacf65a6923fadaf2d9ba9843c..3be2c8ede1c10c91c458e56babb516f7e0c80a21 100644 Binary files a/presentations/09_HLA_HighLevelArchitecture.pptx and b/presentations/09_HLA_HighLevelArchitecture.pptx differ diff --git a/presentations/10_TENA_References.md b/presentations/10_TENA_References.md index 31ae4f4b7fb1fda19b7146ab4314a692fb590bd1..c631616a04553a4d9dfc8b65fef88815573bc5d9 100644 --- a/presentations/10_TENA_References.md +++ b/presentations/10_TENA_References.md @@ -1,5 +1,7 @@  +<!-- View this page at https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/presentations/10_TENA_References.md --> + # Test and Training Enabling Architecture (TENA) TENA is Government Off The Shelf (GOTS) software supporting a wide range of Live Virtual Constructive (LVC) capability. diff --git a/presentations/11a_Certificates_PKI.ppt b/presentations/11a_Certificates_PKI.ppt index 920f483702c6a8f9d9cac36f6fadc8397559ea92..3c174dce6fbc1e57945d7f2e379eaf7e0b70e2b2 100644 Binary files a/presentations/11a_Certificates_PKI.ppt and b/presentations/11a_Certificates_PKI.ppt differ diff --git a/presentations/11b_SimulationAsAService.ppt b/presentations/11b_SimulationAsAService.ppt index 4c9575ca4ae87ba816660236458495b7fb338b56..e2bf9e4991fd8192b7733a221554550cf6aeb50e 100644 Binary files a/presentations/11b_SimulationAsAService.ppt and b/presentations/11b_SimulationAsAService.ppt differ diff --git a/presentations/11c_Clouds_Virtualization.ppt b/presentations/11c_Clouds_Virtualization.ppt index 28d6abc83c748fcae9cc7ffef20903bc5081a2d4..f9fb5b7a78bd6af53ce0383a5ffec5cfac1b6e3a 100644 Binary files a/presentations/11c_Clouds_Virtualization.ppt and b/presentations/11c_Clouds_Virtualization.ppt differ