Interface IExplanationEngine
-
- All Known Implementing Classes:
ExplanationEngine,NoExplanationEngine
public interface IExplanationEngineInterface for Lazy explanation engine.Created by cprudhom on 09/12/14. Project: choco.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidactivePropagator(BoolVar var, Propagator propagator)Explain the activation of a propagator involved in a reified constraintdefault Explanationexplain(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.default voidfreeDecisionExplanation(Decision decision)Free the explanation related to the decision (for efficiency purpose only)default ExplanationgetDecisionRefutationExplanation(Decision decision)Get the explanation of a decision refutationdefault ArrayEventStoregetEventStore()default RuleStoregetRuleStore()default voidinstantiateTo(IntVar var, int val, ICause cause, int oldLB, int oldUB)Explain the assignment tovalofvardue tocause.default booleanisSaveCauses()Indicate whether or not the clauses are saved in Explanationdefault ExplanationmakeExplanation(boolean saveCauses)default voidmoveDecisionRefutation(Decision decision, int to)Move a decision explanation from the old index to the new one.default voidremoveValue(IntVar var, int val, ICause cause)Explain the removal of thevalfromvar, due tocause.default voidstoreDecisionExplanation(Decision decision, Explanation explanation)Store a decision refutation, for future reasoning.default voidundo()Undo the last operation donedefault voidupdateLowerBound(IntVar var, int value, int old, ICause cause)Explain the removal of [old,value[ fromvar, due tocause.default voidupdateUpperBound(IntVar var, int value, int old, ICause cause)Explain the removal of ]value,old] fromvar, due tocause.
-
-
-
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 decisionexplanation- 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 decisionto- 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 thevalfromvar, due tocause. This is the main explanation why we create this class. Record operations to execute for explicit call to explanation.- Parameters:
var- an integer variableval- a valuecause- a cause
-
updateLowerBound
default void updateLowerBound(IntVar var, int value, int old, ICause cause)
Explain the removal of [old,value[ fromvar, due tocause. Prerequisite:valueshould belong tovarThis is the main reason why we create this class. Record operations to execute for explicit call to explanation.- Parameters:
var- an integer variablevalue- a valuecause- a cause
-
updateUpperBound
default void updateUpperBound(IntVar var, int value, int old, ICause cause)
Explain the removal of ]value,old] fromvar, due tocause. Prerequisite:valueshould belong tovarThis is the main reason why we create this class. Record operations to execute for explicit call to explanation.- Parameters:
var- an integer variablevalue- a valuecause- a cause
-
instantiateTo
default void instantiateTo(IntVar var, int val, ICause cause, int oldLB, int oldUB)
Explain the assignment tovalofvardue tocause. This is the main reason why we create this class. Record operations to execute for explicit call to explanation.- Parameters:
var- an integer variableval- a valuecause- a causeoldLB- previous lboldUB- 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 variablepropagator- the propagator to awake.
-
undo
default void undo()
Undo the last operation done
-
-