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());
publicvoidrunSimulationLoops(){
try{
/**
* seconds for real-time execution (not simulation time, which may
* or may not be the same)
*/
finaldoubleSIMULATION_LOOP_DURATION_SECONDS=1.0;
finalintSIMULATION_MAX_LOOP_COUNT=15;// be deliberate out out there! also avoid infinite loops.
intsimulationLoopCount=0;// variable, initialized at 0
booleansimulationComplete=false;// sentinel variable as termination condition,, are we done yet?
booleanfireBool=false;
booleandestBool=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;
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());
@@ -407,82 +397,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
* 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.
* 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