else
sizeOfFalse++;
}
//for hasAgressiveBehavior == true
CPSCompilerMain cpsCompiler = new CPSCompilerMain();
cpsCompiler.InitCompiler();
cpsCompiler.compile( AggressiveBehavior_net +
"defineEvidence( hasAggressiveBehavior, True );"+
"run(LW, " + sizeOfTrue + ");" );
int i = 0;
for (ShipEntity ship : se){
if (ship.hasAggressiveBehaviorState()){
Map<String, String> mapSample = LikelihoodWeighting.This().sampleList.get(i++);
for (String key : mapSample.keySet()){
String value = mapSample.get(key);
if (key.equalsIgnoreCase("speedChange"))
ship.setSpeedChange(Float.valueOf(value));
else
if (key.equalsIgnoreCase("turnRate"))
ship.setTurnRate(Float.valueOf(value));
else
if (key.equalsIgnoreCase("propellerTurnCount"))
ship.setPropellerTurnCount(Float.valueOf(value));
else
if (key.equalsIgnoreCase("shipRCSchange"))
ship.setShipRCSChange(Float.valueOf(value));
else
if (key.equalsIgnoreCase("cavitation"))
ship.setCavitation(Float.valueOf(value));
}
//System.out.println(ship.toString());
}
}
//for hasAgressiveBehavior == false
LikelihoodWeighting.This().sampleList.clear();
cpsCompiler.InitCompiler();
cpsCompiler.compile( AggressiveBehavior_net +
"defineEvidence( hasAggressiveBehavior, False );"+
"run(LW, " + sizeOfFalse + ");" );
i = 0;
for (ShipEntity ship : se){