public final class SatChangesListener extends Object implements AssertionListener, PropagateListener, BackjumpListener
Constructor and Description |
---|
SatChangesListener() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
clears all sets, so that elements occurring in them later result only
from later events
|
void |
ensureAccess(IntVar cpVar)
gets sure we won't have a NullPointerException
|
void |
initialize(Core core)
initializes the component with the given solver.
|
void |
initialize(SatWrapper wrapper) |
void |
onAssertion(int literal,
int level)
Called when a variable is set
|
void |
onBackjump(int oldLevel,
int newLevel)
clear on backjump
|
void |
onPropagate(int literal,
int clauseId)
called when a propagation occurs
|
void |
onRestart(int oldLevel)
called when the solver restarts.
|
String |
toString() |
void |
updateCpVariables(int storeLevel)
Using all data accumulated since last clear(), update the domain
of the given CP variable
|
public void clear()
public void onPropagate(int literal, int clauseId)
PropagateListener
onPropagate
in interface PropagateListener
literal
- the literal propagatedclauseId
- the unique ID of the unit clausepublic void onAssertion(int literal, int level)
AssertionListener
onAssertion
in interface AssertionListener
literal
- the literal that is set
propagation, false otherwiselevel
- the search levelpublic void onBackjump(int oldLevel, int newLevel)
onBackjump
in interface BackjumpListener
oldLevel
- the level at which the solver was before backtrackingnewLevel
- the level to which the solver backtrackspublic void onRestart(int oldLevel)
BackjumpListener
components that want to be warned about restarts should put themselves in Core.restartModules.
onRestart
in interface BackjumpListener
oldLevel
- the level at which the solver was before restartingpublic void updateCpVariables(int storeLevel)
storeLevel
- the current level of the storepublic void ensureAccess(IntVar cpVar)
cpVar
- the CP variable we are about to accesspublic void initialize(Core core)
SolverComponent
initialize
in interface SolverComponent
core
- core component to initializepublic void initialize(SatWrapper wrapper)
Copyright © 2022. All rights reserved.