Interface IExplanationEngine

  • All Known Implementing Classes:
    ExplanationEngine, NoExplanationEngine

    public interface IExplanationEngine
    Interface for Lazy explanation engine.

    Created by cprudhom on 09/12/14. Project: choco.

    • Method Detail

      • isSaveCauses

        default boolean isSaveCauses()
        Indicate whether or not the clauses are saved in Explanation
        Returns:
        if clauses are saved
      • explain

        default Explanation explain​(ContradictionException cex)
        Compute the explanation of the last event from the event store (naturally, the one that leads to a conflict), and return the explanation of the failure, that is, the (sub-)set of decisions and propagators explaining the conflict.
        Parameters:
        cex - contradiction to explain
        Returns:
        an explanation (set of decisions and propagators).
      • makeExplanation

        default Explanation makeExplanation​(boolean saveCauses)
        Parameters:
        saveCauses - set to true if causes need to be stored
        Returns:
        an empty explanation, ready to be filled up
      • getRuleStore

        default RuleStore getRuleStore()
        Returns:
        the current rule store
      • getEventStore

        default ArrayEventStore getEventStore()
        Returns:
        the current store of events
      • getDecisionRefutationExplanation

        default Explanation getDecisionRefutationExplanation​(Decision decision)
        Get the explanation of a decision refutation
        Parameters:
        decision - a refuted decision
        Returns:
        the explanation
      • storeDecisionExplanation

        default void storeDecisionExplanation​(Decision decision,
                                              Explanation explanation)
        Store a decision refutation, for future reasoning.
        Parameters:
        decision - refuted decision
        explanation - the explanation of the refutation
      • moveDecisionRefutation

        default void moveDecisionRefutation​(Decision decision,
                                            int to)
        Move a decision explanation from the old index to the new one. Required for DBT only and should be called with care!
        Parameters:
        decision - a decision
        to - the new index
      • freeDecisionExplanation

        default void freeDecisionExplanation​(Decision decision)
        Free the explanation related to the decision (for efficiency purpose only)
        Parameters:
        decision - the decision which is going to be forgotten
      • removeValue

        default void removeValue​(IntVar var,
                                 int val,
                                 ICause cause)
        Explain the removal of the val from var, due to cause. This is the main explanation why we create this class. Record operations to execute for explicit call to explanation.
        Parameters:
        var - an integer variable
        val - a value
        cause - a cause
      • updateLowerBound

        default void updateLowerBound​(IntVar var,
                                      int value,
                                      int old,
                                      ICause cause)
        Explain the removal of [old,value[ from var, due to cause.

        Prerequisite: value should belong to var This is the main reason why we create this class. Record operations to execute for explicit call to explanation.

        Parameters:
        var - an integer variable
        value - a value
        cause - a cause
      • updateUpperBound

        default void updateUpperBound​(IntVar var,
                                      int value,
                                      int old,
                                      ICause cause)
        Explain the removal of ]value,old] from var, due to cause.

        Prerequisite: value should belong to var This is the main reason why we create this class. Record operations to execute for explicit call to explanation.

        Parameters:
        var - an integer variable
        value - a value
        cause - a cause
      • instantiateTo

        default void instantiateTo​(IntVar var,
                                   int val,
                                   ICause cause,
                                   int oldLB,
                                   int oldUB)
        Explain the assignment to val of var due to cause. This is the main reason why we create this class. Record operations to execute for explicit call to explanation.
        Parameters:
        var - an integer variable
        val - a value
        cause - a cause
        oldLB - previous lb
        oldUB - previous ub
      • activePropagator

        default void activePropagator​(BoolVar var,
                                      Propagator propagator)
        Explain the activation of a propagator involved in a reified constraint
        Parameters:
        var - the reified variable
        propagator - the propagator to awake.
      • undo

        default void undo()
        Undo the last operation done