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

Added a condition to prevent unncecessary interest annouce

parent daec2a74
......@@ -263,6 +263,7 @@ public class RuleManager {
if(transfers.size() == 0){
LOGGER.debug("No transferrable rules");
}
Boolean activatedRule = false;
for (String ruleURI : transfers.keySet()) {
for (String nodeURI : transfers.get(ruleURI)) {
if (E_Centralization.rulePropagationAllowed(Node.getInstance().getConfiguration().getCentralization())) {
......@@ -291,6 +292,7 @@ public class RuleManager {
LOGGER.debug("Shifting a transfer into an activation of "+ruleURI);
// this.shiftTransferIntoInterest(ruleURI);
this.markRuleActivable(ruleURI);
activatedRule = true;
// LOGMODEL.debug(MODEL_MARKER, Node.getInstance().getKBManager().serializeModel());
Model reinference = Node.getInstance().getKBManager().executeRules(true, true);
Node.getInstance().getKBManager().addToModel(reinference);
......@@ -299,7 +301,8 @@ public class RuleManager {
}
}
if (Node.getInstance().getShapesManager().hasActivatedRule(inference) ||
!E_Centralization.rulePropagationAllowed(Node.getInstance().getConfiguration().getCentralization())) {
(!E_Centralization.rulePropagationAllowed(Node.getInstance().getConfiguration().getCentralization()) &&
activatedRule)) {
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),
......
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