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)
BackjumpListenercomponents that want to be warned about restarts should put themselves in Core.restartModules.
onRestart in interface BackjumpListeneroldLevel - the level at which the solver was before restartingpublic void onConflict(MapClause clause, int level)
ConflictListeneronConflict in interface ConflictListenerclause - the conflict (unsatisfiable) clauselevel - the level at which the conflict occurredpublic void onBackjump(int oldLevel,
int newLevel)
BackjumpListenercomponents that want to be warned about backjumps should put themselves in Core.backjumpModules.
onBackjump in interface BackjumpListeneroldLevel - the level at which the solver was before backtrackingnewLevel - the level to which the solver backtrackspublic void onAssertion(int literal,
int level)
AssertionListeneronAssertion in interface AssertionListenerliteral - the literal that is set
propagation, false otherwiselevel - the search levelpublic void onForget()
ForgetListeneronForget in interface ForgetListenerpublic void onPropagate(int literal,
int clauseId)
PropagateListeneronPropagate in interface PropagateListenerliteral - the literal propagatedclauseId - the unique ID of the unit clausepublic void onClauseAdd(int[] clause,
int clauseId,
boolean isModelClause)
ClauseListeneronClauseAdd in interface ClauseListenerclause - the clauseclauseId - the clause's unique IdisModelClause - is this clause a model clause ?public void onClauseRemoval(int clauseId)
ClauseListeneronClauseRemoval in interface ClauseListenerclauseId - the idpublic void onStop()
StartStopListeneronStop in interface StartStopListenerpublic void onStart()
StartStopListeneronStart in interface StartStopListenerpublic final void logStats()
public void initialize(Core core)
SolverComponentinitialize in interface SolverComponentcore - core component to initializeCopyright © 2022. All rights reserved.