public class ExplanationEngine extends Object implements FilteringMonitor
Created by cprudhom on 09/12/14. Project: choco.
Modifier and Type | Field and Description |
---|---|
protected IEventStore |
eventStore |
Constructor and Description |
---|
ExplanationEngine(Solver solver,
boolean userFeedback,
boolean enablePartialExplanation)
Create an explanation engine based on a rule store
|
Modifier and Type | Method and Description |
---|---|
void |
activePropagator(BoolVar var,
Propagator propagator)
Explain the activation of a propagator involved in a reified constraint
|
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.
|
ConflictStrategy |
getCstrat()
Return the conflict strategy declared
|
Explanation |
getDecisionRefutationExplanation(Decision decision)
Get the explanation of a decision refutation
|
IEventStore |
getEventStore() |
RuleStore |
getRuleStore() |
Solver |
getSolver() |
void |
instantiateTo(IntVar var,
int val,
ICause cause,
int oldLB,
int oldUB)
This is the main reason why we create this class.
|
boolean |
isSaveCauses()
Indicate whether or not the clauses are saved in Explanation
|
void |
moveDecisionRefutation(Decision decision,
int to)
Move a decision explanation from the old index to the new one.
|
void |
removeValue(IntVar var,
int val,
ICause cause)
This is the main explanation why we create this class.
|
void |
setCstrat(ConflictStrategy cstrat)
Set the conflict strategy to use
|
void |
storeDecisionExplanation(Decision decision,
Explanation explanation)
Store a decision refutation, for future reasoning.
|
void |
updateLowerBound(IntVar var,
int value,
int old,
ICause cause)
This is the main reason why we create this class.
|
void |
updateUpperBound(IntVar var,
int value,
int old,
ICause cause)
This is the main reason why we create this class.
|
protected final IEventStore eventStore
public ExplanationEngine(Solver solver, boolean userFeedback, boolean enablePartialExplanation)
solver
- a solveruserFeedback
- does user require feedback, ie, keep trace of the constraints in conflict ?enablePartialExplanation
- do explanations need to be complete (for DBT or nogood extraction) ?public ConflictStrategy getCstrat()
public void setCstrat(ConflictStrategy cstrat)
public boolean isSaveCauses()
public Explanation explain(ContradictionException cex)
public RuleStore getRuleStore()
public IEventStore getEventStore()
public Solver getSolver()
public Explanation getDecisionRefutationExplanation(Decision decision)
decision
- a refuted decisionpublic void storeDecisionExplanation(Decision decision, Explanation explanation)
decision
- refuted decisionexplanation
- the explanation of the refutationpublic void moveDecisionRefutation(Decision decision, int to)
decision
- a decisionto
- the new indexpublic void removeValue(IntVar var, int val, ICause cause)
removeValue
in interface FilteringMonitor
var
- an integer variableval
- a valuecause
- a causepublic void updateLowerBound(IntVar var, int value, int old, ICause cause)
updateLowerBound
in interface FilteringMonitor
var
- an integer variablevalue
- a valuecause
- a causeold
- the previous lower boundpublic void updateUpperBound(IntVar var, int value, int old, ICause cause)
updateUpperBound
in interface FilteringMonitor
var
- an integer variablevalue
- a valuecause
- a causeold
- the previous upper boundpublic void instantiateTo(IntVar var, int val, ICause cause, int oldLB, int oldUB)
instantiateTo
in interface FilteringMonitor
var
- an integer variableval
- a valuecause
- a causeoldLB
- previous lboldUB
- previous ubpublic void activePropagator(BoolVar var, Propagator propagator)
FilteringMonitor
activePropagator
in interface FilteringMonitor
var
- the reified variablepropagator
- the propagator to awake.Copyright © 2015. All rights reserved.