public class LastConflict extends AbstractStrategy<Variable> implements IMonitorRestart, IMonitorSolution, IMonitorContradiction
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
active
Set to true when this strategy is active
|
protected Variable[] |
conflictingVariables
Variables related to decision in conflicts
|
protected AbstractStrategy<Variable> |
mainStrategy
The main strategy declared in the solver
|
protected Model |
model
The target solver
|
protected int |
nbCV
Number of conflicts stored
|
protected Set<Variable> |
scope |
vars| Constructor and Description |
|---|
LastConflict(Model model,
AbstractStrategy<Variable> mainStrategy,
int k)
Creates a last conflict heuristic
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterRestart()
Actions to execute after restarting the search
|
void |
beforeRestart()
Actions to execute before restarting the search
|
Decision<Variable> |
getDecision()
Provides access to the current decision in the strategy.
|
boolean |
init()
Prepare
this to be used in a search loop
The initialization can detect inconsistency, in that case, it returns false |
void |
onContradiction(ContradictionException cex) |
void |
onSolution() |
computeDecision, getVariables, makeIntDecision, toStringprotected Model model
protected AbstractStrategy<Variable> mainStrategy
protected boolean active
protected int nbCV
protected Variable[] conflictingVariables
public LastConflict(Model model, AbstractStrategy<Variable> mainStrategy, int k)
model - the solver to attach this tomainStrategy - the main strategy declaredk - the maximum number of conflicts to storepublic boolean init()
AbstractStrategythis to be used in a search loop
The initialization can detect inconsistency, in that case, it returns falseinit in class AbstractStrategy<Variable>public Decision<Variable> getDecision()
AbstractStrategynull.getDecision in class AbstractStrategy<Variable>public void onContradiction(ContradictionException cex)
onContradiction in interface IMonitorContradictionpublic void beforeRestart()
IMonitorRestartbeforeRestart in interface IMonitorRestartpublic void afterRestart()
IMonitorRestartafterRestart in interface IMonitorRestartpublic void onSolution()
onSolution in interface IMonitorSolutionCopyright © 2018. All rights reserved.