Class MeasuresRecorder
- java.lang.Object
-
- org.chocosolver.solver.search.measure.Measures
-
- org.chocosolver.solver.search.measure.MeasuresRecorder
-
- All Implemented Interfaces:
Serializable,Cloneable,IMeasures
public final class MeasuresRecorder extends Measures
Object which stores resolution information to get statistics- Since:
- 3.0.0
- Author:
- Charles Prud'Homme, Arnaud Malapert
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.chocosolver.solver.search.measure.Measures
backtrackCount, boundsManager, depth, failCount, maxDepth, modelName, nodeCount, objectiveOptimal, readingTimeCount, restartCount, solutionCount, state, timeCount
-
-
Constructor Summary
Constructors Constructor Description MeasuresRecorder(String modelName)Create a measures recorder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecDepth()Decrements current depthlonggetTimeCountInNanoSeconds()voidincBackTrackCount()increment backtrack countervoidincDepth()Increments current depthvoidincFailCount()increment fail countervoidincNodeCount()increment node countervoidincRestartCount()increment restart countervoidincSolutionCount()increment solution countervoidreset()Reset every measure to its default value (mostly 0)voidsetBoundsManager(IBoundsManager boundsManager)Update the bounds managedvoidsetObjectiveOptimal(boolean objectiveOptimal)indicates whether or not the optimum has been found and provedvoidsetReadingTimeCount(long readingTimeCount)voidsetSearchState(SearchState state)Update the current search statevoidsetTimeCount(long timeCount)voidstartStopwatch()Start the stopwatch, to compute resolution timevoidstopStopwatch()Stop the stopwatch, the resolution time is fixed.-
Methods inherited from class org.chocosolver.solver.search.measure.Measures
getBackTrackCount, getBestSolutionValue, getBoundsManager, getCurrentDepth, getDecisionCount, getFailCount, getMaxDepth, getModelName, getNodeCount, getReadingTimeCountInNanoSeconds, getRestartCount, getSearchState, getSolutionCount, getTimestamp, hasObjective, isObjectiveOptimal, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.search.measure.IMeasures
getReadingTimeCount, getTimeCount, toArray, toCSV, toDimacsString, toMultiLineString, toOneLineString
-
-
-
-
Constructor Detail
-
MeasuresRecorder
public MeasuresRecorder(String modelName)
Create a measures recorder
-
-
Method Detail
-
getTimeCountInNanoSeconds
public long getTimeCountInNanoSeconds()
- Specified by:
getTimeCountInNanoSecondsin interfaceIMeasures- Overrides:
getTimeCountInNanoSecondsin classMeasures- Returns:
- the time count (in nano seconds), including initial propagation time count
-
startStopwatch
public void startStopwatch()
Start the stopwatch, to compute resolution time
-
stopStopwatch
public void stopStopwatch()
Stop the stopwatch, the resolution time is fixed.
-
setObjectiveOptimal
public final void setObjectiveOptimal(boolean objectiveOptimal)
indicates whether or not the optimum has been found and proved- Parameters:
objectiveOptimal- true if the objective is proven to be optimal
-
reset
public void reset()
Reset every measure to its default value (mostly 0)
-
incNodeCount
public final void incNodeCount()
increment node counter
-
incBackTrackCount
public final void incBackTrackCount()
increment backtrack counter
-
incFailCount
public final void incFailCount()
increment fail counter
-
incRestartCount
public final void incRestartCount()
increment restart counter
-
incSolutionCount
public final void incSolutionCount()
increment solution counter
-
incDepth
public final void incDepth()
Increments current depth
-
decDepth
public final void decDepth()
Decrements current depth
-
setSearchState
public final void setSearchState(SearchState state)
Update the current search state- Parameters:
state- new search state
-
setBoundsManager
public final void setBoundsManager(IBoundsManager boundsManager)
Update the bounds managed- Parameters:
boundsManager- new bound manager
-
setTimeCount
public final void setTimeCount(long timeCount)
-
setReadingTimeCount
public final void setReadingTimeCount(long readingTimeCount)
-
-