Skip to content
Snippets Groups Projects
Commit ce2fb29f authored by Brutzman, Don's avatar Brutzman, Don
Browse files

refactor rename for verbal clarity, simplicity

parent 495b5eac
No related branches found
No related tags found
No related merge requests found
Showing
with 194 additions and 193 deletions
......@@ -17,15 +17,16 @@ import java.util.ArrayList;
// import jdk.internal.vm.annotation.IntrinsicCandidate;
/**
* Handle most networking chores, provide clean interface for programs connecting to OpenDIS7 communications
* Integrate utility capabilities for DisThreadedNetworkInterface to handle most
* networking and entity-management chores, provide clean interface for programs connecting to OpenDis7 communications
* @author brutzman
*/
public class ChannelOpenDis7
public class DisChannel
{
/**
* Output prefix to help with logging by identifying this class.
*/
private String TRACE_PREFIX = "[OpenDis7]"; // might have different ChannelOpenDis7 objects created on different channels, so non-static
private String TRACE_PREFIX = "[OpenDis7]"; // might have different DisChannel objects created on different channels, so non-static
private static String thisHostName = "localhost";
private static final String NETWORK_ADDRESS_DEFAULT = "239.1.2.3";
private static final int NETWORK_PORT_DEFAULT = 3000;
......@@ -45,7 +46,7 @@ public class ChannelOpenDis7
Pdu receivedPdu;
private PduRecorder pduRecorder;
public ChannelOpenDis7()
public DisChannel()
{
DisTime.setTimestampStyle(timestampStyle); // DISTime is a singleton shared class
pduFactory = new PduFactory(timestampStyle);
......
......@@ -19,10 +19,10 @@ import java.util.logging.Logger;
* Default program initialization includes PDU recording turned on by default.
* @see <a href="https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleSimulationProgramLog.txt">ExampleSimulationProgramLog.txt</a>
*/
public class ExampleSimulationProgram // extends ChannelOpenDis7
public class ExampleSimulationProgram // extends DisChannel
{
protected ChannelOpenDis7 channelOpenDis7;
protected PduFactory pduFactory;
protected DisChannel disChannel;
protected PduFactory pduFactory;
/** seconds for real-time execution (not simulation time, which may or may not be .the same) */
double currentTimeStep = 1.0; // seconds
......@@ -52,11 +52,11 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
/** Initialize channel setup for OpenDis7 and report a test PDU */
private void initializeChannelOpenDis7()
{
channelOpenDis7.setUpNetworkInterface();
channelOpenDis7.printlnTRACE ("opendis7.getNetworkAddress()=" + channelOpenDis7.getNetworkAddress() +
", getNetworkPort()=" + channelOpenDis7.getNetworkPort());
disChannel.setUpNetworkInterface();
disChannel.printlnTRACE ("opendis7.getNetworkAddress()=" + disChannel.getNetworkAddress() +
", getNetworkPort()=" + disChannel.getNetworkPort());
// channelOpenDis7.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized");
// disChannel.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized");
}
/** Get ready, get set... initialize simulation entities
......@@ -65,7 +65,7 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
{
initializeChannelOpenDis7();
pduFactory = channelOpenDis7.getPduFactory();
pduFactory = disChannel.getPduFactory();
entityStatePdu_1 = pduFactory.makeEntityStatePdu();
entityStatePdu_2 = pduFactory.makeEntityStatePdu();
firePdu_1a = pduFactory.makeFirePdu();
......@@ -99,8 +99,8 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
// TODO simulation management PDUs for startup, planning to design special class support
// simulationManager.addEntity();
simulationManager.setDescriptor("ExampleSimulationProgram");
simulationManager.addHost(ChannelOpenDis7.getThisHostName());
simulationManager.setDisThreadedNetworkInterface(channelOpenDis7.getDisNetworkInterface());
simulationManager.addHost(DisChannel.getThisHostName());
simulationManager.setDisThreadedNetworkInterface(disChannel.getDisNetworkInterface());
}
/**
......@@ -127,7 +127,7 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
// TODO reset Clock Time to today's date and timestamp to zero, providing consistent outputs for each simulation run
channelOpenDis7.getPduRecorder().setVerbose(true);
disChannel.getPduRecorder().setVerbose(true);
initializeSimulationEntities();
......@@ -183,7 +183,7 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
System.out.println ("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
System.out.flush();
sendAllPdusForLoopTimestep(entityStatePdu_1, firePdu_1a, currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
channelOpenDis7.sendSinglePdu(entityStatePdu_2); // me too i.e. 2!
disChannel.sendSinglePdu(entityStatePdu_2); // me too i.e. 2!
System.out.println ("... [PDUs successfully sent for this loop]");
System.out.flush();
......@@ -196,10 +196,10 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
break;
}
} // end of simulation loop
// ===================================================================================================
// ===================================================================================================// ===================================================================================================
narrativeMessage2 = "runSimulation() completed successfully"; // all done
channelOpenDis7.sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
disChannel.sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
System.out.println ("... [final CommentPdu successfully sent for simulation]");
// TODO simulation management PDUs
......@@ -233,9 +233,9 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
{
// additional constructor initialization goes here
if (channelOpenDis7 == null)
channelOpenDis7 = new ChannelOpenDis7();
pduFactory = channelOpenDis7.getPduFactory();
if (disChannel == null)
disChannel = new DisChannel();
pduFactory = disChannel.getPduFactory();
}
/**
* Utility Constructor that allows your example simulation program to override default network address and port
......@@ -246,9 +246,9 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
{
super();
channelOpenDis7.setNetworkAddress(address);
disChannel.setNetworkAddress(address);
channelOpenDis7.setNetworkPort(port);
disChannel.setNetworkPort(port);
}
/**
......@@ -266,12 +266,12 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
String... comments)
{
if (entityStatePdu != null)
channelOpenDis7.sendSinglePdu(entityStatePdu);
disChannel.sendSinglePdu(entityStatePdu);
if (firePdu != null)
channelOpenDis7.sendSinglePdu(firePdu); // bang
disChannel.sendSinglePdu(firePdu); // bang
channelOpenDis7.sendCommentPdu(commentType, comments); // empty comments are filtered
disChannel.sendCommentPdu(commentType, comments); // empty comments are filtered
}
/**
......@@ -284,9 +284,9 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
if (args.length == 2)
{
if ((args[0] != null) && !args[0].isEmpty())
thisProgram.channelOpenDis7.setNetworkAddress(args[0]);
thisProgram.disChannel.setNetworkAddress(args[0]);
if ((args[1] != null) && !args[1].isEmpty())
thisProgram.channelOpenDis7.setNetworkPort(Integer.parseInt(args[1]));
thisProgram.disChannel.setNetworkPort(Integer.parseInt(args[1]));
}
else if (args.length != 0)
{
......@@ -308,23 +308,23 @@ public class ExampleSimulationProgram // extends ChannelOpenDis7
{
thisProgram = new ExampleSimulationProgram(); // create instance of self
thisProgram.channelOpenDis7.setTRACE_PREFIX("[" + ExampleSimulationProgram.class.getName() + "] ");
thisProgram.disChannel.setTRACE_PREFIX("[" + ExampleSimulationProgram.class.getName() + "] ");
thisProgram.channelOpenDis7.printlnTRACE("main() started...");
thisProgram.disChannel.printlnTRACE("main() started...");
thisProgram = new ExampleSimulationProgram(); // creates instance of self within static main() method
thisProgram.handleArgs (args); // process command-line invocation arguments
thisProgram.channelOpenDis7.setUpNetworkInterface();
thisProgram.disChannel.setUpNetworkInterface();
// thisProgram.pduRecorder.setDescriptor (TRACE_PREFIX.replace("[","").replace("]","") + " pduRecorder"); // optional
thisProgram.runSimulationLoops(); // ... your simulation execution code goes in there ...
thisProgram.channelOpenDis7.tearDownNetworkInterface(); // make sure no processes are left lingering
thisProgram.disChannel.tearDownNetworkInterface(); // make sure no processes are left lingering
thisProgram.channelOpenDis7.printlnTRACE("complete."); // report successful completion
thisProgram.disChannel.printlnTRACE("complete."); // report successful completion
System.exit(0); // ensure all threads and sockets released
}
......
# Start, ENCODING_PLAINTEXT, [pduRecorder null] 20220202_204436, DIS capture file, .\pduLog\PduCaptureLog.dislog
0,0,0,0,0,0,0,0,7,1,1,1,-66,56,115,-77,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,0,6,52,-80,-80,7,1,2,2,-66,56,125,5,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 02 FIRE
0,0,0,0,12,-41,-100,-124,7,1,22,5,-66,84,-113,67,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,0,18,-18,-66,103,7,1,1,1,-66,56,115,-77,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
0,0,0,0,85,-6,-98,-64,7,1,1,1,-66,56,115,-77,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,0,92,82,-32,32,7,1,2,2,-66,56,125,5,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 02 FIRE
0,0,0,0,98,86,-40,-16,7,1,22,5,-66,110,-72,43,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,0,104,-107,3,-52,7,1,1,1,-66,56,115,-77,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
0,0,0,0,-85,-119,-101,52,7,1,1,1,-66,56,115,-77,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,0,-78,93,-44,32,7,1,2,2,-66,56,125,5,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 02 FIRE
0,0,0,0,-72,-69,-109,-65,7,1,22,5,-66,-119,29,-87,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,0,-65,12,-37,48,7,1,1,1,-66,56,115,-77,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
0,0,0,1,1,-81,-16,-108,7,1,1,1,-66,56,115,-77,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,1,8,126,-111,119,7,1,2,2,-66,56,125,5,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 02 FIRE
0,0,0,1,15,15,39,-116,7,1,22,5,-66,-93,121,-45,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,1,21,-124,94,-104,7,1,1,1,-66,56,115,-77,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
0,0,0,1,87,70,7,100,7,1,1,1,-66,56,115,-77,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,1,93,65,108,-28,7,1,2,2,-66,56,125,5,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 02 FIRE
0,0,0,1,100,28,-67,11,7,1,22,5,-66,-67,116,33,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,1,106,59,-85,-48,7,1,1,1,-66,56,115,-77,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
0,0,0,1,113,108,60,-108,7,1,22,5,-66,-63,-125,99,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 # DisPduType 22 COMMENT
# Finish, ENCODING_PLAINTEXT, [pduRecorder null] 20220202_204443, DIS capture file, .\pduLog\PduCaptureLog.dislog
# Start, ENCODING_PLAINTEXT, [pduRecorder null] 20220527_175312, DIS capture file, .\pduLog\PduCaptureLog.dislog
0,0,0,0,0,0,0,0,7,1,1,1,-30,-6,-70,-45,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63,-16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,0,6,107,-6,-104,7,1,2,2,-30,-6,-51,119,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 02 FIRE
0,0,0,0,13,124,-61,108,7,1,22,5,-29,17,96,73,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,0,20,81,-37,-56,7,1,1,1,-30,-6,-65,125,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
0,0,0,0,86,-36,1,-108,7,1,1,1,-30,-6,-70,-45,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,0,92,-36,-104,-60,7,1,2,2,-30,-6,-51,119,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 02 FIRE
0,0,0,0,99,35,-100,-36,7,1,22,5,-29,43,-110,-125,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,0,105,112,48,100,7,1,1,1,-30,-6,-65,125,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
0,0,0,0,-85,-48,119,112,7,1,1,1,-30,-6,-70,-45,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,0,-78,-91,-102,88,7,1,2,2,-30,-6,-51,119,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 02 FIRE
0,0,0,0,-72,-23,-34,36,7,1,22,5,-29,69,-60,-67,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,0,-65,126,71,-24,7,1,1,1,-30,-6,-65,125,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
0,0,0,1,2,90,-109,0,7,1,1,1,-30,-6,-70,-45,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,1,8,-87,-1,12,7,1,2,2,-30,-6,-51,119,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 02 FIRE
0,0,0,1,14,-87,15,56,7,1,22,5,-29,95,-10,-9,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,1,20,-62,101,44,7,1,1,1,-30,-6,-65,125,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
0,0,0,1,86,-49,28,-48,7,1,1,1,-30,-6,-70,-45,0,-112,40,0,0,1,0,2,0,3,1,0,1,3,0,-51,62,2,1,0,0,0,0,-31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,32,69,110,116,105,116,121,32,35,49,0,0,0,0 # DisPduType 01 ENTITY_STATE
0,0,0,1,92,-30,49,-104,7,1,2,2,-30,-6,-51,119,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 02 FIRE
0,0,0,1,99,37,99,-12,7,1,22,5,-29,121,-62,-87,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,0,-81,-46,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,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 # DisPduType 22 COMMENT
0,0,0,1,105,-124,-77,48,7,1,1,1,-30,-6,-65,125,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
0,0,0,1,111,-103,-50,-72,7,1,22,5,-29,125,-112,-83,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 # DisPduType 22 COMMENT
# Finish, ENCODING_PLAINTEXT, [pduRecorder null] 20220527_175320, DIS capture file, .\pduLog\PduCaptureLog.dislog
......@@ -69,8 +69,8 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
entityID_1.setSiteID(1).setApplicationID(2).setEntityID(3); // made-up example ID;
// TODO someday, use enumerations; is there a unique site triplet for MOVES Institute?
channelOpenDis7.getPduRecorder().setVerbose(false);
channelOpenDis7.getPduRecorder().hasVerboseOutput(); // debug check
disChannel.getPduRecorder().setVerbose(false);
disChannel.getPduRecorder().hasVerboseOutput(); // debug check
EntityStatePdu espdu_1 = pduFactory.makeEntityStatePdu();
espdu_1.setEntityID(entityID_1);
......@@ -95,9 +95,9 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
pduTrack_1.addPdu(espdu_1); // initial location
// OK send initial PDUs prior to loop
if (channelOpenDis7.getPduRecorder().hasVerboseOutput())
if (disChannel.getPduRecorder().hasVerboseOutput())
System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
channelOpenDis7.sendSinglePdu(espdu_1);
disChannel.sendSinglePdu(espdu_1);
// sendCommentPdu(currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
pduSentList.add(espdu_1);
reportPdu(simulationLoopCount, espdu_1.getEntityLocation(), directionEntity_1);
......@@ -151,16 +151,16 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
if (false) // real-time operation or simulation speedup
{
Thread.sleep((long) (currentTimeStep * 1000)); // seconds * (1000 msec/sec) = milliseconds
System.out.println(channelOpenDis7.getTRACE_PREFIX() + "Pausing for " + currentTimeStep + " seconds");
System.out.println(disChannel.getTRACE_PREFIX() + "Pausing for " + currentTimeStep + " seconds");
}
// OK now send the status PDUs for this loop, and then continue
if (channelOpenDis7.getPduRecorder().hasVerboseOutput())
if (disChannel.getPduRecorder().hasVerboseOutput())
System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
channelOpenDis7.sendSinglePdu(espdu_1);
channelOpenDis7.sendCommentPdu(currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
if (channelOpenDis7.getPduRecorder().hasVerboseOutput())
System.out.println(channelOpenDis7.getTRACE_PREFIX() + "PDUs successfully sent for this loop");
disChannel.sendSinglePdu(espdu_1);
disChannel.sendCommentPdu(currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
if (disChannel.getPduRecorder().hasVerboseOutput())
System.out.println(disChannel.getTRACE_PREFIX() + "PDUs successfully sent for this loop");
pduSentList.add(espdu_1);
pduTrack_1.addPdu(espdu_1);
Vector3Double location = espdu_1.getEntityLocation();
......@@ -170,15 +170,15 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
// current loop now finished, check whether to terminate if simulation complete, otherwise continue
if (simulationComplete || (simulationLoopCount > 10000)) // for example; including fail-safe condition is good
{
System.out.println(channelOpenDis7.getTRACE_PREFIX() + "loop termination condition met, simulationComplete=" + simulationComplete); // ", final loopCount=" + loopCount +
System.out.println(disChannel.getTRACE_PREFIX() + "loop termination condition met, simulationComplete=" + simulationComplete); // ", final loopCount=" + loopCount +
break;
}
} // end of simulation loop
// ===================================================================================================
System.out.println(channelOpenDis7.getTRACE_PREFIX() + "all PDUs successfully sent for this loop (pduSentList.size()=" + pduSentList.size() + " total)");
System.out.println(disChannel.getTRACE_PREFIX() + "all PDUs successfully sent for this loop (pduSentList.size()=" + pduSentList.size() + " total)");
// track analysis
System.out.println(channelOpenDis7.getTRACE_PREFIX() + "pduTrack_1 initialLocation=" + pduTrack_1.getInitialLocation() + ", latestLocation=" + pduTrack_1.getLatestLocation());
System.out.println(disChannel.getTRACE_PREFIX() + "pduTrack_1 initialLocation=" + pduTrack_1.getInitialLocation() + ", latestLocation=" + pduTrack_1.getLatestLocation());
pduTrack_1.sortPdus()
.createRawWaypoints();
......@@ -190,9 +190,9 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
System.out.println("=================================");
narrativeMessage2 = "runSimulation() completed successfully"; // all done
channelOpenDis7.sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
if (channelOpenDis7.getPduRecorder().hasVerboseOutput())
channelOpenDis7.printlnTRACE("final CommentPdu successfully sent for simulation");
disChannel.sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
if (disChannel.getPduRecorder().hasVerboseOutput())
disChannel.printlnTRACE("final CommentPdu successfully sent for simulation");
// TODO simulation management PDUs
}
catch (InterruptedException iex) // handle any exception that your code might choose to provoke!
......@@ -234,27 +234,27 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
{
thisProgram = new ExampleTrackInterpolation(); // create instance of self
thisProgram.channelOpenDis7.setTRACE_PREFIX("[" + ExampleTrackInterpolation.class.getName() + "] ");
thisProgram.disChannel.setTRACE_PREFIX("[" + ExampleTrackInterpolation.class.getName() + "] ");
thisProgram.channelOpenDis7.printlnTRACE("main() started...");
thisProgram.disChannel.printlnTRACE("main() started...");
thisProgram = new ExampleTrackInterpolation(); // creates instance of self within static main() method
thisProgram.handleArgs (args); // process command-line invocation arguments
thisProgram.channelOpenDis7.setUpNetworkInterface();
thisProgram.disChannel.setUpNetworkInterface();
thisProgram.channelOpenDis7.getPduRecorder().setDescriptor (thisProgram.channelOpenDis7.getTRACE_PREFIX().replace("[","").replace("]","") + " pduRecorder");
thisProgram.disChannel.getPduRecorder().setDescriptor (thisProgram.disChannel.getTRACE_PREFIX().replace("[","").replace("]","") + " pduRecorder");
thisProgram.channelOpenDis7.getPduRecorder().setVerbose(false);
thisProgram.channelOpenDis7.setVerboseComments(false);
thisProgram.channelOpenDis7.getDisNetworkInterface().setVerbose(false);
thisProgram.disChannel.getPduRecorder().setVerbose(false);
thisProgram.disChannel.setVerboseComments(false);
thisProgram.disChannel.getDisNetworkInterface().setVerbose(false);
thisProgram.runSimulationLoops(); // ... your simulation execution code goes in there ...
thisProgram.channelOpenDis7.tearDownNetworkInterface(); // make sure no processes are left lingering
thisProgram.disChannel.tearDownNetworkInterface(); // make sure no processes are left lingering
thisProgram.channelOpenDis7.printlnTRACE("complete."); // report successful completion
thisProgram.disChannel.printlnTRACE("complete."); // report successful completion
System.exit(0); // ensure all threads and sockets released
}
......
......@@ -64,8 +64,8 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
5 Entity location=( 0.0, 5.0, 0.0) NORTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 12] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 12] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 13] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 13] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 13] DisPduType 22 COMMENT, size 120 bytes)
6 Entity location=( 0.0, 6.0, 0.0) NORTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 14] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 14] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
......@@ -84,18 +84,18 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
9 Entity location=( 0.0, 9.0, 0.0) NORTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 20] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 20] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 21] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 21] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 21] DisPduType 22 COMMENT, size 120 bytes)
10 Entity location=( 0.0, 10.0, 0.0) NORTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 22] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 22] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 23] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 22] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 23] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 23] DisPduType 22 COMMENT, size 120 bytes)
11 Entity location=( 1.0, 10.0, 0.0) EAST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 24] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 24] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 25] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 25] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 25] DisPduType 22 COMMENT, size 120 bytes)
12 Entity location=( 2.0, 10.0, 0.0) EAST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 26] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 26] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
......@@ -119,8 +119,8 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
16 Entity location=( 6.0, 10.0, 0.0) EAST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 34] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 34] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 35] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 35] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 35] DisPduType 22 COMMENT, size 120 bytes)
17 Entity location=( 7.0, 10.0, 0.0) EAST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 36] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 36] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
......@@ -142,8 +142,8 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 43] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 43] DisPduType 22 COMMENT, size 120 bytes)
21 Entity location=(10.0, 9.0, 0.0) SOUTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 44] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 44] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 44] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 45] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 45] DisPduType 22 COMMENT, size 120 bytes)
22 Entity location=(10.0, 8.0, 0.0) SOUTH
......@@ -174,8 +174,8 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
27 Entity location=(10.0, 3.0, 0.0) SOUTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 56] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 56] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 57] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 57] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 57] DisPduType 22 COMMENT, size 120 bytes)
28 Entity location=(10.0, 2.0, 0.0) SOUTH
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 58] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 58] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
......@@ -212,10 +212,10 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 71] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 71] DisPduType 22 COMMENT, size 120 bytes)
35 Entity location=( 5.0, 0.0, 0.0) WEST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 72] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 72] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 73] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 72] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 73] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 73] DisPduType 22 COMMENT, size 120 bytes)
36 Entity location=( 4.0, 0.0, 0.0) WEST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 74] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 74] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
......@@ -232,8 +232,8 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 79] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 79] DisPduType 22 COMMENT, size 120 bytes)
39 Entity location=( 1.0, 0.0, 0.0) WEST
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 80] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 80] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 80] DisPduType 01 ENTITY_STATE track path, size 144 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 81] DisPduType 22 COMMENT, size 120 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 81] DisPduType 22 COMMENT, size 120 bytes)
40 Entity location=( 0.0, 0.0, 0.0) WEST
......@@ -255,7 +255,7 @@ pduTrack_1 duration = 42.0 seconds = 0 ticks
<meta content='ExampleTrackInterpolation.x3d' name='title'/>
<meta content='Conversion of ESPDU track into X3D animation interpolators and LineSet.' name='description'/>
<meta content='1 January 2022' name='created'/>
<meta content='22 May 2022' name='modified'/>
<meta content='27 May 2022' name='modified'/>
<meta content='Don Brutzman' name='creator'/>
<meta content='https://gitlab.nps.edu/Savage/NetworkedGraphicsMV3500/-/blob/master/examples/src/OpenDis7Examples/ExampleTrackInterpolation.x3d' name='identifier'/>
<meta content='PduTrack utility, opendis7-java Library https://github.com/open-dis/opendis7-java' name='generator'/>
......
package SimkitOpenDis7Examples;
import OpenDis7Examples.ChannelOpenDis7;
import OpenDis7Examples.DisChannel;
import edu.nps.moves.dis7.enumerations.VariableRecordType;
import simkit.SimEntityBase;
import simkit.random.RandomVariate;
......@@ -19,7 +19,7 @@ import simkit.random.RandomVariate;
*/
public class ArrivalProcessOpenDis7 extends SimEntityBase {
private final ChannelOpenDis7 channelOpenDis7 = new ChannelOpenDis7();
private final DisChannel disChannel = new DisChannel();
/**
* Generates interarrival times
......@@ -32,13 +32,13 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
protected int numberArrivals;
/** Initialize channel setup for OpenDis7 and report a test PDU */
private void initializeChannelOpenDis7()
private void initializeDisChannel()
{
channelOpenDis7.setUpNetworkInterface();
channelOpenDis7.printlnTRACE ("opendis7.getNetworkAddress()=" + channelOpenDis7.getNetworkAddress() +
", getNetworkPort()=" + channelOpenDis7.getNetworkPort());
disChannel.setUpNetworkInterface();
disChannel.printlnTRACE ("disChannel.getNetworkAddress()=" + disChannel.getNetworkAddress() +
", getNetworkPort()=" + disChannel.getNetworkPort());
channelOpenDis7.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized");
disChannel.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized");
}
/**
......@@ -49,7 +49,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
*/
public ArrivalProcessOpenDis7(RandomVariate interarrivalTimeGenerator) {
this.interarrivalTimeGenerator = interarrivalTimeGenerator;
initializeChannelOpenDis7();
initializeDisChannel();
}
/**
......@@ -58,7 +58,7 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
* explicit call to its setter method.
*/
public ArrivalProcessOpenDis7() {
initializeChannelOpenDis7();
initializeDisChannel();
}
/**
......@@ -119,9 +119,9 @@ public class ArrivalProcessOpenDis7 extends SimEntityBase {
}
/**
* @return the channelOpenDis7
* @return the disChannel
*/
public ChannelOpenDis7 getChannelOpenDis7() {
return channelOpenDis7;
public DisChannel getDisChannel() {
return disChannel;
}
}
......@@ -86,7 +86,7 @@ public class RunSimpleServerOpenDis7 {
System.out.println("Execution complete.");
// TODO send simulation management PDUs via DIS channel, announce completion
arrival.getChannelOpenDis7().tearDownNetworkInterface();
arrival.getDisChannel().tearDownNetworkInterface();
System.exit(0); // normal completion
}
}
......@@ -20,8 +20,8 @@ Recorder log file open: C:\x-nps-gitlab\NetworkedGraphicsMV3500\examples\pduLog\
[DisThreadedNetworkInterface] createThreads() sendingThread.isAlive()=true
[PduRecorder PduRecorder] listening to IP address 239.1.2.3 on port 3000
[OpenDis7]opendis7.getNetworkAddress()=239.1.2.3, getNetworkPort()=3000
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 1] DisPduType 22 COMMENT, size 80 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [sending 1] DisPduType 22 COMMENT, size 80 bytes)
[DisThreadedNetworkInterface ExampleSimulationProgram pdu looping] [receipt 1] DisPduType 22 COMMENT, size 80 bytes)
[DisThreadedNetworkInterface PduRecorder] [receipt 1] DisPduType 22 COMMENT, size 80 bytes)
*** [CommentPdu narrative sent: OTHER] [ArrivalProcessOpenDis7 initialized]
ArrivalProcessOpenDis7.1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment