Commit daec2a74 authored by Nicolas Seydoux's avatar Nicolas Seydoux
Browse files

Fixed behavior when adding rules

When a rule was added, the triggered deduction could be lost. The result
of said deduction is now stored into the KB.
parent 2d9f5c1c
......@@ -237,6 +237,7 @@ public class RuleManager {
// LOGGER.debug(ModelPrinter.get().print(report.getModel()));
// }
this.triggerReasoning(false, true);
// LOGGER.trace("Deactivating node-sensitive elements");
// Node.getInstance().getShapesManager().deactivateNodeSensitiveElements();
}
......@@ -292,7 +293,7 @@ public class RuleManager {
this.markRuleActivable(ruleURI);
// LOGMODEL.debug(MODEL_MARKER, Node.getInstance().getKBManager().serializeModel());
Model reinference = Node.getInstance().getKBManager().executeRules(true, true);
// Node.getInstance().getKBManager().addToModel(reinference);
Node.getInstance().getKBManager().addToModel(reinference);
LOGGER.debug("Reinference : " + ModelPrinter.get().print(reinference));
}
}
......@@ -301,6 +302,9 @@ public class RuleManager {
!E_Centralization.rulePropagationAllowed(Node.getInstance().getConfiguration().getCentralization())) {
Node.getInstance().getInterestManager().propagateInterests();
LOGGER.warn("Productions are not annouced");
// If the deduction is obtained when adding the rule (and not when receiving an observation),
// it is never added to the KB, that is why it is done here
Node.getInstance().getKBManager().addToModel(inference);
// Node.getInstance().getProductionManager().pro
}
}
......
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