Package org.ddolib.common.solver.stat
Class DdoStats
java.lang.Object
org.ddolib.common.solver.stat.SearchStatistics
org.ddolib.common.solver.stat.DdoStats
Class tracking statistics specific to Decision Diagram Optimization (DDO) solver.
-
Field Summary
Fields inherited from class org.ddolib.common.solver.stat.SearchStatistics
_bestBound, _currentTime, _frontierMaxSize, _gap, _incumbent, _lastIterationOfGapImprovement, _lastIterationOfImprovement, _lastTimeOfImprovement, _nbDominancePruning, _nbExpandedNodes, _nbFastLowerBoundPruning, _nbGeneratedNodes, _nbIterations, _prevIncumbent, _relativeImprovement, _startTime, _status -
Constructor Summary
ConstructorsConstructorDescriptionDdoStats(long startTime, double initValue) Constructs a new SearchStatistics instance. -
Method Summary
Modifier and TypeMethodDescriptionaddNbDominancePruning(int nbPruning) Creates and returns a copy of this statistics instance with additional nodes pruned by the dominance, for instance those pruned during the compilation of a decision diagram.addNbFastLowerBoundPruning(int nbPruning) Creates and returns a copy of this statistics instance with additional nodes pruned by the fast lower bound, for instance those pruned during the compilation of a decision diagram.addNodeCounts(long nbExpanded, long nbGenerated) Returns a new SearchStatistics instance with the given numbers of expanded and generated nodes added to the current ones.addNodes(int nodes) Updates the total number of nodes created.doubleReturns the best (highest) global lower bound found so far.copy()Creates and returns a copy of this statistics instance.protected DdoStatsCreates a new instance of the specific subclass with initial values.Creates and returns a copy of this statistics instance with one more node pruned by the dominance.Creates and returns a copy of this statistics instance with one more node pruned by the fast lower bound.Returns a new SearchStatistics instance with the iteration count incremented by one.intReturns the iteration during which the last lower bound improvement was found.intReturns the maximum depth reached during the search.longReturns the total number of nodes created in all compiled MDDs.updateBestBound(double bound) Returns a new SearchStatistics instance with an updated best bound.updateFrontierMaxSize(int frontierSize) Returns a new SearchStatistics instance with an updated maximum frontier size.updateGap(double gap) Returns a new SearchStatistics instance with an updated optimality gap.updateIncumbent(double incumbent, double gap) Returns a new SearchStatistics instance with an updated incumbent value and gap.updateLowerBound(double lb) Updates the best lower bound and tracks its improvement iteration.updateMaxDepth(int depth) Updates the maximum depth reached.updateNodeCounts(long nbExpanded, long nbGenerated) Returns a new SearchStatistics instance with the given numbers of expanded and generated nodes (totals since the beginning of the search).updateStatus(SearchStatus status) Returns a new SearchStatistics instance with an updated search status.updateTime(long time) Returns a new SearchStatistics instance with an updated current time.Methods inherited from class org.ddolib.common.solver.stat.SearchStatistics
bestBound, currentTime, frontierMaxSize, gap, incumbent, lastIterationOfGapImprovement, lastIterationOfImprovement, lastTimeOfImprovement, nbDominancePruning, nbExpandedNodes, nbFastLowerBoundPruning, nbGeneratedNodes, nbIterations, prevIncumbent, relativeImprovement, runtime, status, toString
-
Constructor Details
-
DdoStats
public DdoStats(long startTime, double initValue) Constructs a new SearchStatistics instance.- Parameters:
startTime- the start time of the search (in milliseconds)initValue- the initial value for the incumbent
-
-
Method Details
-
createSpecificInstance
Creates a new instance of the specific subclass with initial values. This is used by the copy method to maintain the correct type.- Specified by:
createSpecificInstancein classSearchStatistics- Returns:
- a new instance of the specific subclass
-
copy
Creates and returns a copy of this statistics instance.- Overrides:
copyin classSearchStatistics- Returns:
- a copy of the current statistics
-
updateIncumbent
Returns a new SearchStatistics instance with an updated incumbent value and gap.- Overrides:
updateIncumbentin classSearchStatistics- Parameters:
incumbent- the new incumbent valuegap- the new optimality gap- Returns:
- a new instance with updated incumbent and gap
-
updateStatus
Returns a new SearchStatistics instance with an updated search status.- Overrides:
updateStatusin classSearchStatistics- Parameters:
status- the newSearchStatus- Returns:
- a new instance with the updated status
-
incrementNbIter
Returns a new SearchStatistics instance with the iteration count incremented by one.- Overrides:
incrementNbIterin classSearchStatistics- Returns:
- a new instance with incremented iterations
-
updateFrontierMaxSize
Returns a new SearchStatistics instance with an updated maximum frontier size.- Overrides:
updateFrontierMaxSizein classSearchStatistics- Parameters:
frontierSize- the current frontier size to potentially update the maximum- Returns:
- a new instance with the updated maximum frontier size
-
updateGap
Returns a new SearchStatistics instance with an updated optimality gap.- Overrides:
updateGapin classSearchStatistics- Parameters:
gap- the new gap value- Returns:
- a new instance with the updated gap
-
updateNodeCounts
Returns a new SearchStatistics instance with the given numbers of expanded and generated nodes (totals since the beginning of the search).- Overrides:
updateNodeCountsin classSearchStatistics- Parameters:
nbExpanded- the number of expanded nodesnbGenerated- the number of generated nodes- Returns:
- a new instance with the updated node counts
-
addNodeCounts
Returns a new SearchStatistics instance with the given numbers of expanded and generated nodes added to the current ones.- Overrides:
addNodeCountsin classSearchStatistics- Parameters:
nbExpanded- the number of expanded nodes to addnbGenerated- the number of generated nodes to add- Returns:
- a new instance with the updated node counts
-
updateBestBound
Returns a new SearchStatistics instance with an updated best bound. Any valid lower bound on the optimal value can be given: the best one seen so far is kept.- Overrides:
updateBestBoundin classSearchStatistics- Parameters:
bound- a lower bound on the optimal value- Returns:
- a new instance with the updated best bound
-
updateTime
Returns a new SearchStatistics instance with an updated current time.- Overrides:
updateTimein classSearchStatistics- Parameters:
time- the current time (in milliseconds)- Returns:
- a new instance with the updated time
-
incrementNbFastLowerBoundPruning
Creates and returns a copy of this statistics instance with one more node pruned by the fast lower bound.- Overrides:
incrementNbFastLowerBoundPruningin classSearchStatistics- Returns:
- a new instance with the incremented number of fast lower bound prunings
-
incrementNbDominancePruning
Creates and returns a copy of this statistics instance with one more node pruned by the dominance.- Overrides:
incrementNbDominancePruningin classSearchStatistics- Returns:
- a new instance with the incremented number of dominance prunings
-
addNbFastLowerBoundPruning
Creates and returns a copy of this statistics instance with additional nodes pruned by the fast lower bound, for instance those pruned during the compilation of a decision diagram.- Overrides:
addNbFastLowerBoundPruningin classSearchStatistics- Parameters:
nbPruning- the number of nodes pruned by the fast lower bound to add- Returns:
- a new instance with the updated number of fast lower bound prunings
-
addNbDominancePruning
Creates and returns a copy of this statistics instance with additional nodes pruned by the dominance, for instance those pruned during the compilation of a decision diagram.- Overrides:
addNbDominancePruningin classSearchStatistics- Parameters:
nbPruning- the number of nodes pruned by the dominance to add- Returns:
- a new instance with the updated number of dominance prunings
-
totalNodes
public long totalNodes()Returns the total number of nodes created in all compiled MDDs.- Returns:
- the total number of nodes
-
maxExploredDepth
public int maxExploredDepth()Returns the maximum depth reached during the search.- Returns:
- the maximum depth
-
bestLowerBound
public double bestLowerBound()Returns the best (highest) global lower bound found so far.- Returns:
- the best lower bound
-
lastIterationOfLowerBoundImprovement
public int lastIterationOfLowerBoundImprovement()Returns the iteration during which the last lower bound improvement was found.- Returns:
- the last iteration of lower bound improvement
-
addNodes
Updates the total number of nodes created.- Parameters:
nodes- the number of nodes to add- Returns:
- a new DdoStats instance with updated totalNodes
-
updateMaxDepth
Updates the maximum depth reached.- Parameters:
depth- the current depth- Returns:
- a new DdoStats instance with updated maxExploredDepth
-
updateLowerBound
Updates the best lower bound and tracks its improvement iteration.- Parameters:
lb- the new lower bound- Returns:
- a new DdoStats instance with updated bestLowerBound
-