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

continued refactoring to simplify user example code by pushing functionality into DisChannel

parent 3dfbc6ca
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,10 @@ import java.util.ArrayList; ...@@ -17,8 +17,10 @@ import java.util.ArrayList;
// import jdk.internal.vm.annotation.IntrinsicCandidate; // import jdk.internal.vm.annotation.IntrinsicCandidate;
/** /**
* Integrate utility capabilities for DisThreadedNetworkInterface to handle most * DisChannel integrates multiple utility capabilities to handle most networking and entity-management tasks.
* networking and entity-management chores, provide clean interface for programs connecting to OpenDis7 communications * Provides a simplified interface wrapping DisThreadedNetworkInterface, PduRecorder and SimulationManager
* for programs connecting to OpenDis7 communications.
* TODO future work will confirm that multiple different DisChannel connections can be used simultaneously by a parent program.
* @author brutzman * @author brutzman
*/ */
public class DisChannel public class DisChannel
...@@ -26,7 +28,8 @@ public class DisChannel ...@@ -26,7 +28,8 @@ public class DisChannel
/** /**
* Output prefix to help with logging by identifying this class. * Output prefix to help with logging by identifying this class.
*/ */
private String TRACE_PREFIX = "[OpenDis7]"; // might have different DisChannel objects created on different channels, so non-static private String descriptor = this.getClass().getSimpleName();
private String TRACE_PREFIX = "[" + descriptor + "]"; // might have different DisChannel objects created on different channels, so non-static
private static String thisHostName = "localhost"; private static String thisHostName = "localhost";
private static final String NETWORK_ADDRESS_DEFAULT = "239.1.2.3"; private static final String NETWORK_ADDRESS_DEFAULT = "239.1.2.3";
private static final int NETWORK_PORT_DEFAULT = 3000; private static final int NETWORK_PORT_DEFAULT = 3000;
...@@ -45,6 +48,17 @@ public class DisChannel ...@@ -45,6 +48,17 @@ public class DisChannel
DisThreadedNetworkInterface.PduListener pduListener; DisThreadedNetworkInterface.PduListener pduListener;
Pdu receivedPdu; Pdu receivedPdu;
private PduRecorder pduRecorder; private PduRecorder pduRecorder;
/* VariableRecordType enumerations have potential use with CommentPdu logs */
/* TODO contrast to EntityType */
public final VariableRecordType descriptionCommentType = VariableRecordType.DESCRIPTION;
public final VariableRecordType narrativeCommentType = VariableRecordType.COMPLETE_EVENT_REPORT;
public final VariableRecordType statusCommentType = VariableRecordType.APPLICATION_STATUS;
public final VariableRecordType currentTimeStepCommentType = VariableRecordType.APPLICATION_TIMESTEP;
/** SimulationManager class handles DIS joining, announcing and leaving tasks.
* It is instantiated here as an object */
SimulationManager simulationManager = new SimulationManager();
public DisChannel() public DisChannel()
{ {
...@@ -61,6 +75,27 @@ public class DisChannel ...@@ -61,6 +75,27 @@ public class DisChannel
System.out.println(TRACE_PREFIX + thisHostName + " id not connected to network: " + uhe.getMessage()); System.out.println(TRACE_PREFIX + thisHostName + " id not connected to network: " + uhe.getMessage());
} }
} }
/** Join DIS channel using SimulationManager */
public void join()
{
// TODO simulation management PDUs for startup, planning to design special class support
// simulationManager.addEntity();
simulationManager.setDescriptor(descriptor);
simulationManager.addHost(DisChannel.getThisHostName());
simulationManager.setDisThreadedNetworkInterface(disNetworkInterface);
simulationManager.simulationJoin();
simulationManager.simulationStart();
// TODO consider boolean response indicating if join was successful
}
/** Leave DIS channel using SimulationManager */
public void leave()
{
// TODO send simulation management PDUs
simulationManager.simulationStop();
simulationManager.simulationLeave();
// TODO consider boolean response indicating if leave was successful
}
/** /**
* get current networkAddress as a string * get current networkAddress as a string
...@@ -114,10 +149,11 @@ public class DisChannel ...@@ -114,10 +149,11 @@ public class DisChannel
/** /**
* Initialize network interface, choosing best available network interface * Initialize network interface, choosing best available network interface
*/ */
public void setUpNetworkInterface() { public void setUpNetworkInterface()
{
disNetworkInterface = new DisThreadedNetworkInterface(getNetworkAddress(), getNetworkPort()); disNetworkInterface = new DisThreadedNetworkInterface(getNetworkAddress(), getNetworkPort());
getDisNetworkInterface().setDescriptor("ExampleSimulationProgram pdu looping"); getDisNetworkInterface().setDescriptor(descriptor);
System.out.println("Network confirmation:" + " address=" + getDisNetworkInterface().getAddress() + // disNetworkInterface.getMulticastGroup() + System.out.println(TRACE_PREFIX + "Network confirmation:" + " address=" + getDisNetworkInterface().getAddress() + // disNetworkInterface.getMulticastGroup() +
" port=" + getDisNetworkInterface().getPort()); // + disNetworkInterface.getDisPort()); " port=" + getDisNetworkInterface().getPort()); // + disNetworkInterface.getDisPort());
pduListener = new DisThreadedNetworkInterface.PduListener() { pduListener = new DisThreadedNetworkInterface.PduListener() {
/** Callback handler for listener */ /** Callback handler for listener */
...@@ -128,11 +164,11 @@ public class DisChannel ...@@ -128,11 +164,11 @@ public class DisChannel
}; };
getDisNetworkInterface().addListener(pduListener); getDisNetworkInterface().addListener(pduListener);
String pduLogOutputDirectory = DEFAULT_PDULOG_OUTPUT_DIRECTORY; String pduLogOutputDirectory = DEFAULT_PDULOG_OUTPUT_DIRECTORY;
System.out.println("Beginning pdu save to directory " + pduLogOutputDirectory); System.out.println(TRACE_PREFIX + "Beginning pdu save to directory " + pduLogOutputDirectory);
pduRecorder = new PduRecorder(pduLogOutputDirectory, getNetworkAddress(), getNetworkPort()); // assumes save pduRecorder = new PduRecorder(pduLogOutputDirectory, getNetworkAddress(), getNetworkPort()); // assumes save
getPduRecorder().setEncodingPduLog(PduRecorder.ENCODING_PLAINTEXT); pduRecorder.setEncodingPduLog(PduRecorder.ENCODING_PLAINTEXT);
getPduRecorder().setVerbose(true); // either sending, receiving or both pduRecorder.setVerbose(true); // either sending, receiving or both
getPduRecorder().start(); // begin running pduRecorder.start(); // begin running
} }
/** All done, release network resources */ /** All done, release network resources */
...@@ -155,7 +191,7 @@ public class DisChannel ...@@ -155,7 +191,7 @@ public class DisChannel
} }
catch (InterruptedException ex) catch (InterruptedException ex)
{ {
System.err.println(this.getClass().getName() + " Error sending PDU: " + ex.getLocalizedMessage()); System.err.println(this.getClass().getSimpleName() + " Error sending PDU: " + ex.getLocalizedMessage());
System.exit(1); System.exit(1);
} }
} }
...@@ -192,7 +228,7 @@ public class DisChannel ...@@ -192,7 +228,7 @@ public class DisChannel
sendSinglePdu(commentPdu); sendSinglePdu(commentPdu);
if (isVerboseComments()) if (isVerboseComments())
{ {
System.out.println("*** [CommentPdu narrative sent: " + commentType.name() + "] " + newCommentsList.toString()); System.out.println(TRACE_PREFIX + "*** [CommentPdu narrative sent: " + commentType.name() + "] " + newCommentsList.toString());
System.out.flush(); System.out.flush();
} }
} }
...@@ -280,4 +316,27 @@ public class DisChannel ...@@ -280,4 +316,27 @@ public class DisChannel
public PduRecorder getPduRecorder() { public PduRecorder getPduRecorder() {
return pduRecorder; return pduRecorder;
} }
/**
* Get simple descriptor (such as parent class name) for this network interface, used in trace statements
* @return simple descriptor name
*/
public String getDescriptor() {
return descriptor;
}
/**
* Set new simple descriptor (such as parent class name) for this network interface, used in trace statements
* @param newDescriptor simple descriptor name for this interface
*/
public void setDescriptor(String newDescriptor) {
if (newDescriptor == null)
newDescriptor = "";
this.descriptor = newDescriptor;
TRACE_PREFIX = "[" + descriptor + "]"; // might have different DisChannel objects created on different channels, so non-static
if (disNetworkInterface != null)
disNetworkInterface.setDescriptor(descriptor);
if (simulationManager != null)
simulationManager.setDescriptor(descriptor);
}
} }
...@@ -46,25 +46,22 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -46,25 +46,22 @@ public class ExampleSimulationProgram // extends DisChannel
/** MunitionDescriptor for these weapons */ /** MunitionDescriptor for these weapons */
protected MunitionDescriptor munitionDescriptor1; protected MunitionDescriptor munitionDescriptor1;
/** this class instantiated as an object */
SimulationManager simulationManager = new SimulationManager();
/** Initialize channel setup for OpenDis7 and report a test PDU */ /** Initialize channel setup for OpenDis7 and report a test PDU */
private void initializeChannelOpenDis7() private void initializeChannelOpenDis7()
{ {
disChannel.setDescriptor(this.getClass().getSimpleName()); // ExampleSimulationProgram might be a superclass
disChannel.setUpNetworkInterface(); disChannel.setUpNetworkInterface();
disChannel.printlnTRACE ("opendis7.getNetworkAddress()=" + disChannel.getNetworkAddress() + disChannel.printlnTRACE (" disChannel.getNetworkAddress()=" + disChannel.getNetworkAddress() +
", getNetworkPort()=" + disChannel.getNetworkPort()); ", getNetworkPort()=" + disChannel.getNetworkPort());
disChannel.join(); // TODO further functionality expected
// disChannel.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized"); // disChannel.sendCommentPdu(VariableRecordType.OTHER, "ArrivalProcessOpenDis7 initialized");
} }
/** Get ready, get set... initialize simulation entities /** Get ready, get set... initialize simulation entities
*/ */
public void initializeSimulationEntities() public void initializeSimulationEntities()
{ {
initializeChannelOpenDis7();
pduFactory = disChannel.getPduFactory(); pduFactory = disChannel.getPduFactory();
entityStatePdu_1 = pduFactory.makeEntityStatePdu(); entityStatePdu_1 = pduFactory.makeEntityStatePdu();
entityStatePdu_2 = pduFactory.makeEntityStatePdu(); entityStatePdu_2 = pduFactory.makeEntityStatePdu();
...@@ -96,11 +93,7 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -96,11 +93,7 @@ public class ExampleSimulationProgram // extends DisChannel
munitionDescriptor1.setQuantity(1); munitionDescriptor1.setQuantity(1);
firePdu_1a.setDescriptor(munitionDescriptor1).setRange(1000.0f); firePdu_1a.setDescriptor(munitionDescriptor1).setRange(1000.0f);
// TODO simulation management PDUs for startup, planning to design special class support initializeChannelOpenDis7();
// simulationManager.addEntity();
simulationManager.setDescriptor("ExampleSimulationProgram");
simulationManager.addHost(DisChannel.getThisHostName());
simulationManager.setDisThreadedNetworkInterface(disChannel.getDisNetworkInterface());
} }
/** /**
...@@ -131,9 +124,6 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -131,9 +124,6 @@ public class ExampleSimulationProgram // extends DisChannel
initializeSimulationEntities(); initializeSimulationEntities();
simulationManager.simulationJoin();
simulationManager.simulationStart();
// =================================================================================================== // ===================================================================================================
// loop the simulation while allowed, programmer can set additional conditions to break out and finish // 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? while (simulationLoopCount < SIMULATION_MAX_LOOP_COUNT) // are we done yet?
...@@ -141,7 +131,7 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -141,7 +131,7 @@ public class ExampleSimulationProgram // extends DisChannel
simulationLoopCount++; // good practice: increment loop counter as first action in that loop simulationLoopCount++; // good practice: increment loop counter as first action in that loop
// ============================================================================================= // =============================================================================================
// * your own simulation code starts here! * // * your own simulation code starts here! *****************************************************
// ============================================================================================= // =============================================================================================
// are there any other variables to modify at the beginning of your loop? // are there any other variables to modify at the beginning of your loop?
...@@ -171,20 +161,24 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -171,20 +161,24 @@ public class ExampleSimulationProgram // extends DisChannel
simulationComplete = true; simulationComplete = true;
} }
// ============================================================================================= // =============================================================================================
// * your own simulation code is finished here! * // * your own simulation code is finished here! ************************************************
// ============================================================================================= // =============================================================================================
// staying synchronized with timestep: wait duration for elapsed time in this loop // 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 needs a (long) parameter for milliseconds, which are clumsy to use sometimes
Thread.sleep((long)(currentTimeStep * 1000)); // seconds * (1000 msec/sec) = milliseconds Thread.sleep((long)(currentTimeStep * 1000)); // units of seconds * (1000 msec/sec) = milliseconds
System.out.println ("... [Pausing for " + currentTimeStep + " seconds]"); System.out.println ("... [Pausing for " + currentTimeStep + " seconds]");
// OK now send the status PDUs for this loop, and then continue // 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"); System.out.println ("sending PDUs of interest for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
System.out.flush(); System.out.flush();
sendAllPdusForLoopTimestep(entityStatePdu_1, firePdu_1a, currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3);
sendAllPdusForLoopTimestep(entityStatePdu_1,
firePdu_1a,
disChannel.currentTimeStepCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
disChannel.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.println ("... [PDUs of interest successfully sent for this loop]");
System.out.flush(); System.out.flush();
// =============================== // ===============================
...@@ -199,16 +193,14 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -199,16 +193,14 @@ public class ExampleSimulationProgram // extends DisChannel
// ===================================================================================================// =================================================================================================== // ===================================================================================================// ===================================================================================================
narrativeMessage2 = "runSimulation() completed successfully"; // all done narrativeMessage2 = "runSimulation() completed successfully"; // all done
disChannel.sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); disChannel.sendCommentPdu(disChannel.narrativeCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
System.out.println ("... [final CommentPdu successfully sent for simulation]"); System.out.println ("... [final=completion CommentPdu successfully sent for simulation]");
// TODO simulation management PDUs disChannel.leave();
simulationManager.simulationStop();
simulationManager.simulationLeave();
} }
catch (InterruptedException iex) // handle any exception that your code might choose to provoke! catch (InterruptedException iex) // handle any exception that your code might choose to provoke!
{ {
Logger.getLogger(ExampleSimulationProgram.class.getName()).log(Level.SEVERE, null, iex); Logger.getLogger(ExampleSimulationProgram.class.getSimpleName()).log(Level.SEVERE, null, iex);
} }
} }
/* **************************** infrastructure code, modification is seldom needed ************************* */ /* **************************** infrastructure code, modification is seldom needed ************************* */
...@@ -216,13 +208,6 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -216,13 +208,6 @@ public class ExampleSimulationProgram // extends DisChannel
String narrativeMessage1 = new String(); String narrativeMessage1 = new String();
String narrativeMessage2 = new String(); String narrativeMessage2 = new String();
String narrativeMessage3 = new String(); String narrativeMessage3 = new String();
/* VariableRecordType enumerations have potential use with CommentPdu logs */
/* TODO contrast to EntityType */
VariableRecordType descriptionComment = VariableRecordType.DESCRIPTION;
VariableRecordType narrativeComment = VariableRecordType.COMPLETE_EVENT_REPORT;
VariableRecordType statusComment = VariableRecordType.APPLICATION_STATUS;
VariableRecordType currentTimeStepComment = VariableRecordType.APPLICATION_TIMESTEP;
/** /**
* Constructor to create an instance of this class. * Constructor to create an instance of this class.
...@@ -306,14 +291,12 @@ public class ExampleSimulationProgram // extends DisChannel ...@@ -306,14 +291,12 @@ public class ExampleSimulationProgram // extends DisChannel
*/ */
public static void main(String[] args) public static void main(String[] args)
{ {
thisProgram = new ExampleSimulationProgram(); // create instance of self thisProgram = new ExampleSimulationProgram(); // create instance of self within static main() method
thisProgram.disChannel.setTRACE_PREFIX("[" + ExampleSimulationProgram.class.getName() + "] "); thisProgram.disChannel.setTRACE_PREFIX("[" + ExampleSimulationProgram.class.getSimpleName() + "] ");
thisProgram.disChannel.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.handleArgs (args); // process command-line invocation arguments
thisProgram.disChannel.setUpNetworkInterface(); thisProgram.disChannel.setUpNetworkInterface();
......
# Start, ENCODING_PLAINTEXT, [pduRecorder null] 20220527_175312, DIS capture file, .\pduLog\PduCaptureLog.dislog # Start, ENCODING_PLAINTEXT, [pduRecorder null] 20220528_023636, DIS capture file, .\pduLog\PduCaptureLog1.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,0,0,0,0,7,1,1,1,-100,16,-56,-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,6,40,-118,36,7,1,2,2,-100,16,-42,-49,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,12,-110,109,-8,7,1,22,5,-100,44,-61,-59,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,18,115,68,64,7,1,1,1,-100,16,-51,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,85,-118,76,-40,7,1,1,1,-100,16,-56,-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,91,-89,-96,-84,7,1,2,2,-100,16,-42,-49,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,97,-41,-88,0,7,1,22,5,-100,70,-24,3,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,103,-37,-14,-40,7,1,1,1,-100,16,-51,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,-86,87,-74,56,7,1,1,1,-100,16,-56,-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,-80,107,102,-36,7,1,2,2,-100,16,-42,-49,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,-74,-97,-123,116,7,1,22,5,-100,96,-53,3,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,0,-67,113,-12,-112,7,1,1,1,-100,16,-51,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,0,-1,-7,-105,100,7,1,1,1,-100,16,-56,-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,6,-72,-40,-68,7,1,2,2,-100,16,-42,-49,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,13,-106,-119,-32,7,1,22,5,-100,123,90,113,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,19,-77,37,-72,7,1,1,1,-100,16,-51,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,85,-31,-10,-88,7,1,1,1,-100,16,-56,-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,91,-36,-82,84,7,1,2,2,-100,16,-42,-49,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,98,-101,-41,16,7,1,22,5,-100,-107,84,-65,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,105,98,-99,4,7,1,1,1,-100,16,-51,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 0,0,0,1,111,-105,85,-124,7,1,22,5,-100,-103,72,11,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 # Finish, ENCODING_PLAINTEXT, [pduRecorder null] 20220528_023643, DIS capture file, .\pduLog\PduCaptureLog1.dislog
...@@ -98,7 +98,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram ...@@ -98,7 +98,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
if (disChannel.getPduRecorder().hasVerboseOutput()) if (disChannel.getPduRecorder().hasVerboseOutput())
System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent"); System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
disChannel.sendSinglePdu(espdu_1); disChannel.sendSinglePdu(espdu_1);
// sendCommentPdu(currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); // sendCommentPdu(currentTimeStepCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
pduSentList.add(espdu_1); pduSentList.add(espdu_1);
reportPdu(simulationLoopCount, espdu_1.getEntityLocation(), directionEntity_1); reportPdu(simulationLoopCount, espdu_1.getEntityLocation(), directionEntity_1);
...@@ -111,7 +111,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram ...@@ -111,7 +111,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
simulationTime += currentTimeStep; // good practice: update clock along with loop index simulationTime += currentTimeStep; // good practice: update clock along with loop index
// ============================================================================================= // =============================================================================================
// * your own simulation code starts here! * // * your own simulation code starts here! *****************************************************
// ============================================================================================= // =============================================================================================
// are there any other variables to modify at the beginning of your loop? // 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... // compute a track, update an ESPDU, whatever it is that your model is doing...
...@@ -143,7 +143,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram ...@@ -143,7 +143,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
simulationComplete = true; simulationComplete = true;
} }
// ============================================================================================= // =============================================================================================
// * your own simulation code is finished here! * // * your own simulation code is finished here! ************************************************
// ============================================================================================= // =============================================================================================
// staying synchronized with timestep: wait duration for elapsed time in this loop // staying synchronized with timestep: wait duration for elapsed time in this loop
...@@ -158,7 +158,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram ...@@ -158,7 +158,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
if (disChannel.getPduRecorder().hasVerboseOutput()) if (disChannel.getPduRecorder().hasVerboseOutput())
System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent"); System.out.println("sending PDUs for simulation step " + simulationLoopCount + ", monitor loopback to confirm sent");
disChannel.sendSinglePdu(espdu_1); disChannel.sendSinglePdu(espdu_1);
disChannel.sendCommentPdu(currentTimeStepComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); disChannel.sendCommentPdu(disChannel.currentTimeStepCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
if (disChannel.getPduRecorder().hasVerboseOutput()) if (disChannel.getPduRecorder().hasVerboseOutput())
System.out.println(disChannel.getTRACE_PREFIX() + "PDUs successfully sent for this loop"); System.out.println(disChannel.getTRACE_PREFIX() + "PDUs successfully sent for this loop");
pduSentList.add(espdu_1); pduSentList.add(espdu_1);
...@@ -190,14 +190,14 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram ...@@ -190,14 +190,14 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
System.out.println("================================="); System.out.println("=================================");
narrativeMessage2 = "runSimulation() completed successfully"; // all done narrativeMessage2 = "runSimulation() completed successfully"; // all done
disChannel.sendCommentPdu(narrativeComment, narrativeMessage1, narrativeMessage2, narrativeMessage3); disChannel.sendCommentPdu(disChannel.narrativeCommentType, narrativeMessage1, narrativeMessage2, narrativeMessage3);
if (disChannel.getPduRecorder().hasVerboseOutput()) if (disChannel.getPduRecorder().hasVerboseOutput())
disChannel.printlnTRACE("final CommentPdu successfully sent for simulation"); disChannel.printlnTRACE("final CommentPdu successfully sent for simulation");
// TODO simulation management PDUs // TODO simulation management PDUs
} }
catch (InterruptedException iex) // handle any exception that your code might choose to provoke! catch (InterruptedException iex) // handle any exception that your code might choose to provoke!
{ {
Logger.getLogger(ExampleTrackInterpolation.class.getName()).log(Level.SEVERE, null, iex); Logger.getLogger(ExampleTrackInterpolation.class.getSimpleName()).log(Level.SEVERE, null, iex);
} }
} }
...@@ -234,7 +234,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram ...@@ -234,7 +234,7 @@ public class ExampleTrackInterpolation extends ExampleSimulationProgram
{ {
thisProgram = new ExampleTrackInterpolation(); // create instance of self thisProgram = new ExampleTrackInterpolation(); // create instance of self
thisProgram.disChannel.setTRACE_PREFIX("[" + ExampleTrackInterpolation.class.getName() + "] "); thisProgram.disChannel.setTRACE_PREFIX("[" + ExampleTrackInterpolation.class.getSimpleName() + "] ");
thisProgram.disChannel.printlnTRACE("main() started..."); thisProgram.disChannel.printlnTRACE("main() started...");
......
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