public class LearnExplained extends Object implements Learn
Modifier and Type | Field and Description |
---|---|
protected Explanation |
lastExplanation
The last explanation computed.
|
protected IExplanationEngine |
mExplainer
The explanation engine, which computes and returns explanation of a state.
|
protected Model |
mModel
The solver to explain.
|
Constructor and Description |
---|
LearnExplained(Model mModel,
boolean partialExplanationsOn,
boolean recordCauses)
Equips the solver with an explanation engine, which is able to explain failures and solutions.
|
Modifier and Type | Method and Description |
---|---|
void |
forget(Solver solver)
Forget some pieces of knowledge.
|
Explanation |
getLastExplanation()
Return the explanation of the last conflict
|
void |
onFailure(Solver solver)
Actions to do when a failure is met.
|
void |
onSolution(Solver solver)
Actions to do when a solution is found.
|
void |
record(Solver solver)
Validate and record a new piece of knowledge, that is, the current position is a dead-end.
|
protected final Model mModel
protected final IExplanationEngine mExplainer
protected Explanation lastExplanation
public LearnExplained(Model mModel, boolean partialExplanationsOn, boolean recordCauses)
mModel
- the solver to equippartialExplanationsOn
- set to true to enable partial explanations, false otherwiserecordCauses
- set to true to record causes in explanations, false otherwiseSolverException
- if views are enabled. Views provide incomplete explanation.public void record(Solver solver)
Learn
public void forget(Solver solver)
Learn
public void onSolution(Solver solver)
public void onFailure(Solver solver)
public final Explanation getLastExplanation()
Copyright © 2018. All rights reserved.