Commit acd705aa by Alan White

Attempt to fix preconditions for forwarding in speed mode

parent 61867e6e
......@@ -4,7 +4,7 @@ MAS twtest {
//note; other infrastructures not tested or supported
infrastructure: Centralised
environment: truckworld.env.Cargoworld("paperWorld2.properties", "defaultSim.properties", "1", "maint-speed")
environment: truckworld.env.Cargoworld("paperWorld2.properties", "w2/nonDetnonDebilSim.properties", "1", "maint-speed")
//87654321
//987654321
......
#Properties for paper; configures world simulation
windyChangeChance = 0.3
closeRoadChance = 0.6
openRoadChance = 0.1
addDzChance = 0.5
removeDzChance = 0.5
maxRoadClosuresPerStep = 3
maxDzPerStep = 4
proportionMaxBlocked = 0.6
proportionDzLimit = 0.6
closeRoadChance = 0.5
openRoadChance = 0.15
addDzChance = 0.6
removeDzChance = 0.25
maxRoadClosuresPerStep = 1
maxDzPerStep = 3
proportionMaxBlocked = 0.3
proportionDzLimit = 0.4
#
# RAIN PROPERTIES
......
/* Initial beliefs and rules */
//added dynamically - i.e. dynamically created environment
//agent mirrors a 'real world' object...
/* Initial goals */
//none
/* Plans */
//to test nesting of calls to obligant
@test[atomic]
+!test(A,B,C): true <- test(A); subTest(B, C). //involve self in call, with C
@subTest[atomic]
+!subTest(B,C): true <- test1(B); test2(C); .print("Done subtest ", B, ",", C).
/* Initial beliefs and rules */
//added dynamically - i.e. dynamically created environment
//agent mirrors a 'real world' object...
/* Initial goals */
//none
/* Plans */
//to test nesting of calls to obligant
@test[atomic]
+!test(A,B,C): true <- test1(A); subTest(B, C); .print("Done test ", A, ",", B).
@subTest[atomic]
+!subTest(B,C): true <- test1(B); test2(C); .print("Done subtest ", B, ",", C).
/* Initial beliefs and rules */
//added dynamically - i.e. dynamically created environment
//agent mirrors a 'real world' object...
/* Initial goals */
//none
/* Plans */
//to test nesting of calls to obligant
@test[atomic]
+!test(A,B,C): true <- test1(A); subTest(B, C); .print("Done test ", A, ",", B).
@subTest[atomic]
+!subTest(B,C): true <- test1(B); test2(C); .print("Done subtest ", B, ",", C).
/*
This ASL represents a commander agent used for testing
*/
/* Initial beliefs and rules */
//added dynamically - i.e. dynamically created environment
//agent mirrors a 'real world' object...
/* Initial goals */
!start. //register with the simulator as a vehicle with random start position
/* Plans */
//triggering event: context/preconditions <- body/actions
+!start : true <- register. //register - logical agent
//respond to cargo required events...
@createSupplyGoal//[atomic]
+cargoNeeded(J, I): registered("testCommander") & not busy("testCommander")
<- test("test1", "test2", "test3").//; test("test3", "test2", "test1").
......@@ -744,18 +744,7 @@ public class CompositeCapability extends AbstractCapability {
return getPossiblePlans(u, context);
}
/**
* Takes the given precondition and threshold and - if implemented - modifies it with constraints. Used
* for EC advertisement of caps
* @param pre
* @param maintenanceThreshold
* @return
*/
public String modifyPreconditionWithConfConstraint(String pre, float maintenanceThreshold) {
return pre;
}
public Collection<? extends ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb) {
public Collection<ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb) {
final Collection<ExternalCapability> set = new Vector<>();
GoalTask goal = achieves();
float conf = getGeneralConfidence(bb);
......@@ -780,6 +769,18 @@ public class CompositeCapability extends AbstractCapability {
}
public Collection<? extends ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb, final float minConf) {
return this.getConfidenceBasedPreconditionEcs(bb);
final Collection<ExternalCapability> set = new Vector<>();
final Collection<ExternalCapability> defaultSet = this.getConfidenceBasedPreconditionEcs(bb);
if(getHolder().getId().startsWith("military") && this.getSignature().getFunctor().contains("decontaminate")) {
logger.severe(set.toString());
}
for(final ExternalCapability ec: defaultSet) {
if(ec.getConfidenceBasedPreconditions(bb)[0].getConfidence()>minConf) {
set.add(ec);
}
}
return set;
}
}
......@@ -117,10 +117,10 @@ public class CompositeCapabilityManager {
if(t.getSignature().getFunctor().equals("moveTo") && (agent instanceof VehicleAgent) && !(agent instanceof HeliAgent)) {
c = new MoveToCapability(agent, t, p);
}
else if(t.getSignature().getFunctor().equals(WorldAction.unblock.name()) && !(agent.getId().toLowerCase().startsWith("logistics"))) {
else if(t.getSignature().getFunctor().equals(WorldAction.unblock.name())) {
c = new UnblockPlanCapability(agent, t, p);
}
else if(t.getSignature().getFunctor().equals("decontaminateRoad") && !(agent.getId().toLowerCase().startsWith("military"))) {
else if(t.getSignature().getFunctor().toLowerCase().contains("decontaminate")) {
c = new DecontaminatePlanCapability(agent, t, p);
}
else if(t.getSignature().getFunctor().equals("moveTo") && (agent instanceof HeliAgent)) {
......
......@@ -59,10 +59,10 @@ public abstract class GoalRecorderCapability implements Capability {
resultsQueue.add(entry);
}
/**
/*
* Calculate and return success rate
* @return float value
*/
*
private final float calcSuccessRate() {
if(resultsQueue.size()==0) { return 1; }//assume success until disproven
......@@ -86,7 +86,7 @@ public abstract class GoalRecorderCapability implements Capability {
return avgSuccess;
}
}*/
/**
* Calculates success rate based on past history, performing any historical
......
......@@ -28,12 +28,10 @@ import agent.AgentUtils;
import agent.model.capability.Capability;
import agent.model.capability.CompositeCapability;
import agent.model.capability.CompositeCapabilityManager;
import agent.model.capability.ConfidencePrecondition;
import agent.model.capability.ExternalCapability;
import agent.model.capability.ExternalCapabilityService;
import agent.model.capability.PrimitiveCapability;
import agent.model.capability.factory.PrimitiveCapabilityFactory;
import agent.model.goal.GoalTask;
import agent.model.goal.factory.TaskFactory;
import agent.type.arch.MultiagentArch;
import common.UniversalConstants;
......@@ -240,15 +238,6 @@ public abstract class CapabilityAwareAgent extends GoalScoringAgent {
protected abstract Collection<? extends ExternalCapability> getEcsForCompositeCapabilities(final CompositeCapability cc);
/**
* Takes 'pre' and adds confidence constraints if we support MPs
* @param pre
* @param cc
* @return
*/
protected abstract String constrainCC(String pre, CompositeCapability cc);
/**
* Calculate confidence for an unground plan; use calc(planbody) type for the ground plans
* @param p
* @param bb
......
......@@ -1633,14 +1633,7 @@ public abstract class MaintainingAgent extends ContractFormerAgent {
return false; // failure case - not handled
}
/**
* Drops an intention in response to a 'drop' type maintenance task;
* includes dependency cancellation and obligant information if required.
* NOT CURRENTLY IMPLEMENTED.
*
* @param t
* @return boolean if intention drop scheduled successfully
*/
/** NOT CURRENTLY IMPLEMENTED.*/
private boolean handleDrop(MaintenanceTask t) {
return false;
}
......@@ -1654,10 +1647,10 @@ public abstract class MaintainingAgent extends ContractFormerAgent {
* offending step with a subgoal addition, leading into a new plan (for this
* intention execution only) which performs restorative actions and then the
* original, source literal (keep annotations the same here, to preserve
* existing obliogation contracts)
* existing obligation contracts)
*
* @param t
* @return boolean true if intention succesfully updated
* @return boolean true if intention successfully updated
*/
private boolean handlePre(final MaintenanceTask t) {
// (new code for lpg usage)
......@@ -3291,7 +3284,6 @@ public abstract class MaintainingAgent extends ContractFormerAgent {
*/
if (planner.getPlanningMode().equals(Mode.speed)) {
return cc.getConfidenceBasedPreconditionEcs(getBB(), getMaintenancePolicy(cc.getSignature().getFunctor()).maintenanceThreshold());
} else {
return cc.getConfidenceBasedPreconditionEcs(getBB());
}
......
package agent.type;
import jason.asSyntax.Literal;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
......@@ -19,22 +17,14 @@ import agent.maintenance.DefaultMaintenancePolicy;
import agent.maintenance.MaintenancePolicy;
import agent.maintenance.NoHandleMaintenancePolicy;
import agent.maintenance.ReplanMaintenancePolicy;
import agent.model.capability.CompositeCapability;
import agent.model.capability.ExternalCapability;
import common.UniversalConstants;
import jason.asSyntax.Literal;
/**
*
* @author Alan
*
* Abstract class encapsulating MP holding and access
*/
public abstract class MaintenancePolicyHolder extends CapabilityAwareAgent {
/**
* If set to true, add additional constraint preconds to advertised ccs
*/
private static final boolean ADVERTISE_CCS_WITH_CONF_CONSTRAINT = false;
/**
* Maps a policy to a capability; keyed by capability name (string) OR by 'DEFAULT'.
......@@ -114,15 +104,6 @@ public abstract class MaintenancePolicyHolder extends CapabilityAwareAgent {
}
}
protected String constrainCC(String pre, CompositeCapability cc) {
if(ADVERTISE_CCS_WITH_CONF_CONSTRAINT) {
MaintenancePolicy mp = getMaintenancePolicy(pre);
pre = cc.modifyPreconditionWithConfConstraint(pre, mp.maintenanceThreshold());
}
return pre;
}
/*=========================================================================================================
* Methods used to determine casual links of plans
*========================================================================================================*/
......
......@@ -96,7 +96,7 @@ public class Cargoworld extends Environment {
* So if speed =1 and this = 1, then travelling 1 unit takes 1ms. this = 0.1
* then 10ms. 0.01, then 100ms; etc. (lower scalar=slower)
*/
public static final float SPEED_TIME_SCALAR = 1f;// 0.05-0.1f for
public static final float SPEED_TIME_SCALAR = 2f;// 0.05-0.1f for
// experiment, 0.02 good
// for debug? Was 0.3
......@@ -3806,11 +3806,6 @@ public class Cargoworld extends Environment {
getEnvironmentInfraTier().getRuntimeServices().stopMAS();
}
/**
* Map of roads to agents stuck there...
*
* @return
*/
public Map<String, Vector<String>> getStuckAgents() {
synchronized (stuckAgents) {
return stuckAgents;
......
......@@ -103,11 +103,7 @@ public class Watchdog implements Runnable {
} else {
env.addDisplayString("Inactivity timeout");
logger.severe("Generating a new cargo demand - activity timeout");
env.dumpState();
if(env.getLastActionResult().equals(ActionResult.pass)) {
if(demandsGenerated>0 && env.getLastActionResult().equals(ActionResult.pass)) {
logger.severe("Timeout despite successful last action (" + env.getLastActionLiteral() + ")!");
}
lastReqGen = System.currentTimeMillis();
......@@ -150,12 +146,7 @@ public class Watchdog implements Runnable {
private void endExperiment() throws Exception {
env.addDisplayString("Complete: shutting down");
logger.severe("(1) All done; shutting down");
long runTime = System.currentTimeMillis() - start;
long second = (runTime / 1000) % 60;
long minute = (runTime / (1000 * 60)) % 60;
long hour = (runTime / (1000 * 60 * 60)) % 24;
String time = String.format("%02d:%02d:%02d:%d", hour, minute, second, runTime);
JOptionPane.showMessageDialog(env.getUi(), new String[] { "Complete; shutting agents/env down!", "Elapsed: " + time });
JOptionPane.showMessageDialog(env.getUi(), new String[] { "Complete; shutting agents/env down!", "Elapsed: " + calculateElapsedTimeSince(start) });
env.stop();
env.kill();
}
......@@ -300,7 +291,7 @@ public class Watchdog implements Runnable {
return running;
}
public String getElapsed() {
public final static String calculateElapsedTimeSince(final long start) {
final long runTime = System.currentTimeMillis() - start;
final long second = (runTime / 1000) % 60;
final long minute = (runTime / (1000 * 60)) % 60;
......
......@@ -22,16 +22,6 @@ import truckworld.env.Cargoworld;
import agent.beliefBase.WorldBeliefBase;
import agent.type.MaintainingAgent;
/**
*
* @author Alan
*
* Special class to enforce BB remove of literals in belief deletion events. Also introduces
* 'heartbeat' events intended to prevent environment timeouts during meta-reasoning.
*
*/
public class TruckworldAgent extends MaintainingAgent {
/**
......
......@@ -16,18 +16,10 @@ import jason.asSyntax.Plan;
import jason.bb.BeliefBase;
import vehicle.capabilities.truck.MoveRoad;
/**
*
* @author alanwhite
*
* Special case for plans for logistics hq to perform bulldozing. Required as the
* plan is unground until the internal action for selection is performed - i.e. until we have a defined bulldozer.
*/
public class DecontaminatePlanCapability extends CompositeCapability {
public DecontaminatePlanCapability(CapabilityAwareAgent agent, GoalTask task, Plan plan){
super(agent, task, plan);
this.getConfidenceBasedPreconditions(agent.getBB());
}
public DecontaminatePlanCapability(CapabilityAwareAgent agent, GoalTask task){
......@@ -97,25 +89,20 @@ public class DecontaminatePlanCapability extends CompositeCapability {
return getGeneralConfidence(bb);
}
public String modifyPreconditionWithConfConstraint(String pre, float maintenanceThreshold) {
if(maintenanceThreshold > MoveRoad.SLIPPERY_MODIFIER) {
return pre.replaceAll("not flooded", "dry");
}
else {
return pre;
}
}
@Override
public ConfidencePrecondition[] getConfidenceBasedPreconditions(final BeliefBase context) {
final ArrayList<ConfidencePrecondition> preconds = new ArrayList<>();
final float generalConfidence = this.getGeneralConfidence(context);
for(final String originalPrecond : this.getPreconditions()) {
if(originalPrecond.contains("not flooded")) {
String pre1 = originalPrecond.replaceAll("\\(not \\(flooded", "(dry");
pre1 = pre1.substring(0, pre1.lastIndexOf(')'));
String pre2 = originalPrecond.replaceAll("\\(not \\(flooded", "(slippery");
pre2 = pre2.substring(0, pre2.lastIndexOf(')'));
if(originalPrecond.contains("not \\(flooded")) {
final String pre1 = originalPrecond.replaceAll("not \\(flooded", "(dry");
final String pre2 = originalPrecond.replaceAll("not \\(flooded", "(slippery");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre1, generalConfidence));
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre2, generalConfidence*MoveRoad.SLIPPERY_MODIFIER));
}
else if(originalPrecond.contains("not flooded")) {
final String pre1 = originalPrecond.replaceAll("not flooded", "dry");
final String pre2 = originalPrecond.replaceAll("not flooded", "slippery");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre1, generalConfidence));
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre2, generalConfidence*MoveRoad.SLIPPERY_MODIFIER));
}
......@@ -127,7 +114,7 @@ public class DecontaminatePlanCapability extends CompositeCapability {
}
@Override
public Collection<? extends ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb) {
public Collection<ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb) {
final Collection<ExternalCapability> set = new Vector<>();
GoalTask goal = achieves();
float conf = getGeneralConfidence(bb);
......@@ -143,26 +130,23 @@ public class DecontaminatePlanCapability extends CompositeCapability {
es = es + " " + eff[i];
}
logger.finer(plan.getTrigger().getLiteral() + " Composite posteffects = " + es + ", for plan\n" + plan.toASString());
float cost = holder.agentUtils().getActionCount(plan.getBody(), false);
if(pre.contains("(not (flooded")) {
String pre1 = pre.replaceAll("\\(not \\(flooded", "(dry");
pre1 = pre1.substring(0, pre1.lastIndexOf(')'));
final float cost = holder.agentUtils().getActionCount(plan.getBody(), false);
if(pre.contains("not (flooded")) {
final String pre1 = pre.replaceAll("not \\(flooded", "(dry");
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre1, conf),
eff, cost, false));
String pre2 = pre.replaceAll("\\(not \\(flooded", "(slippery");
pre2 = pre2.substring(0, pre2.lastIndexOf(')'));
final String pre2 = pre.replaceAll("not \\(flooded", "(slippery");
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre2, conf*MoveRoad.SLIPPERY_MODIFIER),
eff, cost, false));
}
else if(pre.contains("not (flooded")) {
else if(pre.contains("not flooded")) {
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre.replaceAll("not \\(flooded", "(slippery"), conf),
new ConfidencePrecondition(holder.getId(), getSignature(), pre.replaceAll("not flooded", "dry"), conf),
eff, cost, false));
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre.replaceAll("not \\(flooded", "(slippery"), conf*MoveRoad.SLIPPERY_MODIFIER),
new ConfidencePrecondition(holder.getId(), getSignature(), pre.replaceAll("not flooded", "slippery"), conf*MoveRoad.SLIPPERY_MODIFIER),
eff, cost, false));
}
else {
......
......@@ -94,22 +94,23 @@ public class UnblockPlanCapability extends CompositeCapability {
public float getSpecificConfidence(BeliefBase bb, Literal action) {
return getGeneralConfidence(bb);
}
public String modifyPreconditionWithConfConstraint(String pre, float maintenanceThreshold) {
if(maintenanceThreshold > MoveRoad.SLIPPERY_MODIFIER) { return pre.replaceAll("not flooded", "dry"); }
else { return pre; }
}
@Override
public ConfidencePrecondition[] getConfidenceBasedPreconditions(final BeliefBase context) {
final ArrayList<ConfidencePrecondition> preconds = new ArrayList<>();
final float generalConfidence = this.getGeneralConfidence(context);
for(final String originalPrecond : this.getPreconditions()) {
if(originalPrecond.contains("(not (flooded")) {
final String pre1 = originalPrecond.replaceAll("\\(not \\(flooded", "(dry");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre1.substring(0, pre1.lastIndexOf(')')), generalConfidence));
final String pre2 = originalPrecond.replaceAll("\\(not \\(flooded", "(slippery");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre2.substring(0, pre2.lastIndexOf(')')), generalConfidence*MoveRoad.SLIPPERY_MODIFIER));
if(originalPrecond.contains("not (flooded")) {
final String pre1 = originalPrecond.replaceAll("not \\(flooded", "(dry");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre1, generalConfidence));
final String pre2 = originalPrecond.replaceAll("not \\(flooded", "(slippery");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre2, generalConfidence*MoveRoad.SLIPPERY_MODIFIER));
}
else if(originalPrecond.contains("not flooded")) {
final String pre1 = originalPrecond.replaceAll("not flooded", "dry");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre1, generalConfidence));
final String pre2 = originalPrecond.replaceAll("not flooded", "slippery");
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), pre2, generalConfidence*MoveRoad.SLIPPERY_MODIFIER));
}
else {
preconds.add(new ConfidencePrecondition(holder.getId(), getSignature(), originalPrecond, generalConfidence));
......@@ -119,7 +120,7 @@ public class UnblockPlanCapability extends CompositeCapability {
}
@Override
public Collection<? extends ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb) {
public Collection<ExternalCapability> getConfidenceBasedPreconditionEcs(final BeliefBase bb) {
final Collection<ExternalCapability> set = new Vector<>();
GoalTask goal = achieves();
float conf = getGeneralConfidence(bb);
......@@ -136,26 +137,24 @@ public class UnblockPlanCapability extends CompositeCapability {
}
logger.finer(plan.getTrigger().getLiteral() + " Composite posteffects = " + es + ", for plan\n" + plan.toASString());
float cost = holder.agentUtils().getActionCount(plan.getBody(), false);
//(location(R1) & (location(R2) & (road(RID,R1,R2) & (blocked(R1,R2) & (not (dangerZone(R1)) & (not (dangerZone(R2)) &
//(not (toxic(R1,R2)) & (tarmac(R1,R2) & not (flooded(R1,R2))))))))))
if(pre.contains("(not (flooded")) {
String pre1 = pre.replaceAll("\\(not \\(flooded", "(dry");
pre1 = pre1.substring(0, pre1.lastIndexOf(')'));
if(pre.contains("not (flooded")) {
final String pre1 = pre.replaceAll("not \\(flooded", "(dry");
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre1, conf),
eff, cost, false));
String pre2 = pre.replaceAll("\\(not \\(flooded", "(slippery");
pre2 = pre2.substring(0, pre2.lastIndexOf(')'));
final String pre2 = pre.replaceAll("not \\(flooded", "(slippery");
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre2, conf*MoveRoad.SLIPPERY_MODIFIER),
eff, cost, false));
}
else if(pre.contains("not (flooded")) {
else if(pre.contains("not flooded")) {
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre.replaceAll("not \\(flooded", "(dry"), conf),
new ConfidencePrecondition(holder.getId(), getSignature(),
pre.replaceAll("not flooded", "dry"), conf),
eff, cost, false));
set.add(new ExternalCapability(plan.getTrigger().getLiteral(), goal, holder,
new ConfidencePrecondition(holder.getId(), getSignature(), pre.replaceAll("not \\(flooded", "(slippery"), conf*MoveRoad.SLIPPERY_MODIFIER),
new ConfidencePrecondition(holder.getId(), getSignature(),
pre.replaceAll("not flooded", "slippery"), conf*MoveRoad.SLIPPERY_MODIFIER),
eff, cost, false));
}
else {
......
......@@ -33,40 +33,31 @@ public class UnblockRoad extends VehicleCapability {
private static String[] defEff = { "-blocked(O, J)", "-blocked(J, O)", "-atJ(AGENT, O)", "+atJ(AGENT, J)" };
/**
* Effects; agent is at end point of road, road is unblocked
*/
private final ConfidencePrecondition[] confPre;
/**
* Default constructor
*
* @param holder
*/
public UnblockRoad(VehicleAgent holder) {
super(holder, holder.getTaskFactory().factory(WorldAction.unblock.name()),
Literal.parseLiteral("unblock(AGENT, RID, O, J)"), defPre, defEff);
confPre = new ConfidencePrecondition[] {
new ConfidencePrecondition(holder.getId(), sigLit,
"connection(RID) & location(J) & location(O) & road(RID, O, J) & healthy(AGENT) & "
+ " blocked(O, J) & not toxic(O,J) & not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & atJ(AGENT, O) & dry(O, J)",
"connection(RID) & location(J) & location(O) & road(RID, O, J) & healthy(AGENT) & blocked(O, J) & not toxic(O,J) "
+ "& not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & atJ(AGENT, O) & dry(O, J)",
1),
// damage = 0.8
new ConfidencePrecondition(holder.getId(), sigLit,
"connection(RID) & location(J) & location(O) & road(RID, O, J) & damaged(AGENT) & "
+ " blocked(O, J) & not toxic(O,J) & not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & atJ(AGENT, O) & dry(O, J)",
"connection(RID) & location(J) & location(O) & road(RID, O, J) & damaged(AGENT) & blocked(O, J) & not toxic(O,J) "
+ "& not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & atJ(AGENT, O) & dry(O, J)",
DAMAGE_AGENT_MODIFIER),
// slippery = 0.8
new ConfidencePrecondition(holder.getId(), sigLit,
"connection(RID) & location(J) & location(O) & road(RID, O, J) & healthy(AGENT) & blocked(O, J) & not toxic(O,J) & "
+ "not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & tarmac(O,J) & atJ(AGENT, O) & slippery(O, J)",
"connection(RID) & location(J) & location(O) & road(RID, O, J) & healthy(AGENT) & blocked(O, J) & not toxic(O,J) "
+ "& not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & tarmac(O,J) & atJ(AGENT, O) & slippery(O, J)",
SLIPPERY_MODIFIER),
// slippery AND damaged = 0.8*0.8
new ConfidencePrecondition(holder.getId(), sigLit,
"connection(RID) & location(J) & location(O) & road(RID, O, J) & damaged(AGENT) & blocked(O, J) & not toxic(O,J) & "
+ "not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & tarmac(O,J) & atJ(AGENT, O) & slippery(O, J)",
"connection(RID) & location(J) & location(O) & road(RID, O, J) & damaged(AGENT) & blocked(O, J) & not toxic(O,J) "
+ "& not dangerZone(O) & not dangerZone(J) & not stuck(AGENT) & tarmac(O,J) & atJ(AGENT, O) & slippery(O, J)",
SLIPPERY_MODIFIER * DAMAGE_AGENT_MODIFIER) };
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment