System.out.println("range: "+range+" hops from our Network DMZ!");
if(range<5){// Range 5
if(!fireBool){
if(range<5){// Range 5
sendSinglePdu(MalPacketDetectedComment);
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());
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());
* Send a single Protocol Data Unit (PDU) of any type
System.exit(1);
* @param pdu the pdu to send
}
*/
}
privatevoidsendSinglePdu(Pdupdu)
{
/**
try
* 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
disNetworkInterface.send(pdu);
* @param commentType enumeration value describing purpose of the narrative comment
Thread.sleep(100);// TODO consider refactoring the wait logic and moving externally
* @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
* @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 entityStatePdu the ESPDU to send, if any
* @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
// vararg... variable-length set of String comments can optionally follow
String...comments)
/**
{
* Send EntityState, Fire, Comment PDUs that got updated for this loop, reflecting state of current simulation timestep.
if(entityStatePdu!=null)
* @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
sendSinglePdu(entityStatePdu);
* @param entityStatePdu the ESPDU to send, if any
* @param firePdu the FirePDU to send, if any
if(firePdu!=null)
* @param commentType enumeration value describing purpose of the narrative comment
sendSinglePdu(firePdu);// bang
* @param comments String array of narrative comments
newCommentsList.add(comment);// OK found something to send
}
}
}
}
if(!newCommentsList.isEmpty())
/**
{
* Main method is first executed when a program instance is loaded.
if(commentType==null)
* @see <a href="https://docs.oracle.com/javase/tutorial/getStarted/application/index.html">Java Tutorials: A Closer Look at the "Hello World!" Application</a>
commentType=otherComment;// fallback value otherComment
* @param args command-line arguments are an array of optional String parameters that are passed from execution environment during invocation
// now build the commentPdu from these string inputs, thus constructing a narrative entry
// initial execution: can handle args array of initialization arguments here
if(args.length==2)
/**
{
* Main method is first executed when a program instance is loaded.
if((args[0]!=null)&&!args[0].isEmpty())
* @see <a href="https://docs.oracle.com/javase/tutorial/getStarted/application/index.html">Java Tutorials: A Closer Look at the "Hello World!" Application</a>
thisProgram.setNetworkAddress(args[0]);
* @param args command-line arguments are an array of optional String parameters that are passed from execution environment during invocation