public final class StatModule extends Object implements AssertionListener, BackjumpListener, ConflictListener, ForgetListener, ClauseListener, PropagateListener, StartStopListener
Constructor and Description |
---|
StatModule(boolean threaded)
Create a StatModule.
|
Modifier and Type | Method and Description |
---|---|
void |
initialize(Core core)
initializes the component with the given solver.
|
void |
logStats()
print current stats with solver's logc2 method
|
void |
onAssertion(int literal,
int level)
Called when a variable is set
|
void |
onBackjump(int oldLevel,
int newLevel)
Called when the solver backtracks.
|
void |
onClauseAdd(int[] clause,
int clauseId,
boolean isModelClause)
called when the given clause is added.
|
void |
onClauseRemoval(int clauseId)
called when the clause with unique Id @param clauseId is removed
|
void |
onConflict(MapClause clause,
int level)
called when a conflict occurs
|
void |
onForget()
called when the solver's forget() method is applied.
|
void |
onPropagate(int literal,
int clauseId)
called when a propagation occurs
|
void |
onRestart(int oldLevel)
called when the solver restarts.
|
void |
onStart()
called when the solver starts search.
|
void |
onStop()
called when the solver stop search, for any reason
|
public StatModule(boolean threaded)
threaded
- true if threadedpublic 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 onConflict(MapClause clause, int level)
ConflictListener
onConflict
in interface ConflictListener
clause
- the conflict (unsatisfiable) clauselevel
- the level at which the conflict occurredpublic void onBackjump(int oldLevel, int newLevel)
BackjumpListener
components that want to be warned about backjumps should put themselves in Core.backjumpModules.
onBackjump
in interface BackjumpListener
oldLevel
- the level at which the solver was before backtrackingnewLevel
- the level to which the solver backtrackspublic void onAssertion(int literal, int level)
AssertionListener
onAssertion
in interface AssertionListener
literal
- the literal that is set
propagation, false otherwiselevel
- the search levelpublic void onForget()
ForgetListener
onForget
in interface ForgetListener
public void onPropagate(int literal, int clauseId)
PropagateListener
onPropagate
in interface PropagateListener
literal
- the literal propagatedclauseId
- the unique ID of the unit clausepublic void onClauseAdd(int[] clause, int clauseId, boolean isModelClause)
ClauseListener
onClauseAdd
in interface ClauseListener
clause
- the clauseclauseId
- the clause's unique IdisModelClause
- is this clause a model clause ?public void onClauseRemoval(int clauseId)
ClauseListener
onClauseRemoval
in interface ClauseListener
clauseId
- the idpublic void onStop()
StartStopListener
onStop
in interface StartStopListener
public void onStart()
StartStopListener
onStart
in interface StartStopListener
public final void logStats()
public void initialize(Core core)
SolverComponent
initialize
in interface SolverComponent
core
- core component to initializeCopyright © 2022. All rights reserved.