Skip to content
Snippets Groups Projects
Commit 5ea80305 authored by ctsfi's avatar ctsfi
Browse files

Merge origin/master

parents 11ffe8fa 9105d2ee
No related branches found
No related tags found
No related merge requests found
......@@ -218,6 +218,7 @@ public class BrittSimulation
boolean simulationComplete = false; // sentinel variable as termination condition
boolean fireBool = false;
boolean destBool = false;
boolean resupBool = false;
// TODO reset clock to zero each time for consistent outputs.
// your model setup: who's who in this zoo?
......@@ -234,19 +235,19 @@ public class BrittSimulation
EntityID M49ID = new EntityID();
M49ID.setSiteID(1);
M49ID.setApplicationID(13);
M49ID.setEntityID(26);
entityStatePdu.setEntityID(M49ID);
EntityType M49Type = new EntityType(); //1.1.225.7.1.11 Platform,Ground,USA,M49
M49Type.setEntityKind(EntityKind.PLATFORM);
M49Type.setDomain(Domain.inst(PlatformDomain.LAND));
M49Type.setCountry(Country.UNITED_STATES_OF_AMERICA_USA);
M49Type.setCategory(7);
M49Type.setSubCategory(1);
M49Type.setSpecific(11);
entityStatePdu.setEntityType(M49Type);
EntityID MTVRID = new EntityID();
MTVRID.setSiteID(1);
MTVRID.setApplicationID(13);
MTVRID.setEntityID(26);
entityStatePdu.setEntityID(MTVRID);
EntityType MTVRType = new EntityType(); //1.1.225.7.39.3 MTVR
MTVRType.setEntityKind(EntityKind.PLATFORM);
MTVRType.setDomain(Domain.inst(PlatformDomain.LAND));
MTVRType.setCountry(Country.UNITED_STATES_OF_AMERICA_USA);
MTVRType.setCategory(7);
MTVRType.setSubCategory(39);
MTVRType.setSpecific(3);
entityStatePdu.setEntityType(MTVRType);
Vector3Double eloc2 = new Vector3Double();
double[] loc2 = CoordinateConversions.getXYZfromLatLonDegrees(36.599831, -121.878842, 0); //sloat delmonte intersection
eloc2.setX(loc2[0]);
......@@ -262,21 +263,20 @@ public class BrittSimulation
EntityStatePdu entityStatePdu2 = pduFactory.makeEntityStatePdu();
EntityID NPSID = new EntityID();
NPSID.setSiteID(1);
NPSID.setApplicationID(13);
NPSID.setEntityID(27);
entityStatePdu2.setEntityID(NPSID);
EntityType NPSType = new EntityType(); //5.1.0.14.1.3 NPS Building not sure if this is the right info but its the enumeration of a building in the siso doc
NPSType.setEntityKind(EntityKind.CULTURAL_FEATURE);
NPSType.setDomain(Domain.inst(PlatformDomain.LAND));
NPSType.setCountry(Country.UNITED_STATES_OF_AMERICA_USA);
NPSType.setCategory(14);
NPSType.setSubCategory(1);
NPSType.setSpecific(3);
entityStatePdu2.setEntityType(NPSType);
EntityID lavID = new EntityID();
lavID.setSiteID(1);
lavID.setApplicationID(13);
lavID.setEntityID(25);
entityStatePdu2.setEntityID(lavID);
EntityType lavType = new EntityType(); //1.1.225.2.41.3 Platform,Ground,USA,ArmoredFightingVehicle,LAV,LAV25A2
lavType.setEntityKind(EntityKind.PLATFORM);
lavType.setDomain(Domain.inst(PlatformDomain.LAND));
lavType.setCountry(Country.UNITED_STATES_OF_AMERICA_USA);
lavType.setCategory(2);
lavType.setSubCategory(41);
lavType.setSpecific(3);
entityStatePdu2.setEntityType(lavType);
Vector3Double eloc1 = new Vector3Double();
double[] loc1 = CoordinateConversions.getXYZfromLatLonDegrees(36.594116, -121.877463, 0); //NPS Main Gate
eloc1.setX(loc1[0]);
......@@ -327,10 +327,21 @@ public class BrittSimulation
HEID.setEntityID(1);
firePdu.setMunitionExpendibleID(HEID);
ResupplyOfferPdu resupplyOfferPdu = pduFactory.makeResupplyOfferPdu();
ArrayList<SupplyQuantity> pSupplies = new ArrayList<SupplyQuantity>();
SupplyQuantity ammoSupplyQ = new SupplyQuantity();
ammoSupplyQ.setSupplyType(HEType);
ammoSupplyQ.setQuantity(500);
pSupplies.add(ammoSupplyQ);
resupplyOfferPdu.setSupplies(pSupplies);
resupplyOfferPdu.setReceivingEntityID(lavID);
resupplyOfferPdu.setSupplyingEntityID(MTVRID);
CommentReliablePdu bmpDestroyedComment = pduFactory.makeCommentReliablePdu("BMP2 DESTROYED BY LAV25-A2 AFTER TWO BURSTS OF 25mm HEI-T ON TARGET");
CommentReliablePdu bmpSightedComment = pduFactory.makeCommentReliablePdu("LAV25-A2 ACQUIRES TARGET BMP2 WITHIN FIRING DISTANCE");
//if(eloc1.getX())
CommentReliablePdu lavSightedComment = pduFactory.makeCommentReliablePdu("LAV25-A2 IS WITHIN DISTANCE OF RESUPPLY");
//if(eloc1.getX())
// should we customize this munition? what is it for your simulation?
......@@ -358,13 +369,16 @@ public class BrittSimulation
// etc. etc. your code goes here
if(range < 100){
if (!fireBool)
sendPDU(bmpSightedComment);
fireBool = true;
System.out.println("Entity#" + firePdu.getFiringEntityID().getEntityID() + " is firing " + firePdu.getDescriptor().getMunitionType().getDomain() + "."+firePdu.getDescriptor().getMunitionType().getCountry() + "." + firePdu.getDescriptor().getMunitionType().getCategory() + "."+ firePdu.getDescriptor().getMunitionType().getSubCategory() + "." + firePdu.getDescriptor().getMunitionType().getSpecific() + "."+ " at Entity#"+ firePdu.getTargetEntityID().getEntityID());
if (!resupBool)
sendPDU(lavSightedComment);
resupBool = true;
System.out.println("Entity#" + entityStatePdu.getEntityID().getEntityID() + " is requesting to resupply " + " Entity#"+ entityStatePdu2.getEntityID().getEntityID());
if(firePdu.getTargetEntityID().getEntityID() == 2){
if(firePdu.getTargetEntityID().getEntityID() == 2){
BMPHitsReceived += 1;
if (BMPHitsReceived > 1) {
//DESTROY THE BMP!
......@@ -403,8 +417,8 @@ public class BrittSimulation
//sendAllPdus(entityStatePdu2, null, null, narrativeMessage1, narrativeMessage2, narrativeMessage4);
sendPDU(entityStatePdu);
sendPDU(entityStatePdu2);
if (fireBool)
sendPDU(firePdu);
if (resupBool)
sendPDU(resupplyOfferPdu);
if (destBool)
sendPDU(bmpDestroyedComment);
......@@ -414,7 +428,7 @@ public class BrittSimulation
// loop now finished, thus terminate if simulation complete, otherwise send latest PDUs and continue
if (simulationComplete || (loopCount > 10000)) // for example; including fail-safe condition is good
{
CommentReliablePdu completionPdu = pduFactory.makeCommentReliablePdu("White Simulation Completed");
CommentReliablePdu completionPdu = pduFactory.makeCommentReliablePdu("Britt Simulation Completed");
sendPDU(completionPdu);
System.out.println ("... Termination condition met, simulationComplete=" + simulationComplete);
break;
......
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