Interface DdoModel<T>
- Type Parameters:
T- the state type
- All Superinterfaces:
Model<T>
- All Known Implementing Classes:
ExactModel
A DdoModel extends the generic Model interface by providing
methods related to relaxation, ranking, width control, and frontier management.
It serves as the foundation for implementing algorithms that construct and explore
decision diagrams dynamically (e.g., exact or approximate methods).
This interface provides several default behaviors, which can be overridden to customize model evaluation, search strategy, or diagram generation.
Responsibilities
- Provide the problem relaxation used for node evaluation (
relaxation()). - Define the ranking strategy between states (
ranking()). - Control the diagram’s width through heuristics (
widthHeuristic()). - Specify how to maintain and update the frontier (
frontier()). - Indicate optional behaviors like caching (
useCache()) or exporting the structure (exportDot()).
-
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this model but without dominance.Returns a copy of this model but withoutFastLowerBound.default booleanIndicates whether the generated decision diagram should be exported to a DOT file (Graphviz format).fixWidth(int width) Returns a copy of this model but with a fixed width.frontier()Returns the frontier management strategy used to store and expand the current layer of the decision diagram.default StateRanking<T> ranking()Returns the ranking function used to order states within a layer.Returns the relaxation of the model used to evaluate the nodes or layers of the decision diagram.default ReductionStrategy<T> Strategy to select which nodes should be merged together on a relaxed DD.default ReductionStrategy<T> Strategy to select which nodes should be dropped on a restricted DD.setCutSetType(CutSetType type) Returns a copy of this model by changing theCutSetType.default StateDistance<T> default ExactModel<T> Convert this model into a model for the exact solver.default booleanuseCache()Indicates whether caching should be used during the diagram construction.useCache(boolean b) Returns a copy of this model by enabling or disabling the cache.default booleanuseLNS()default WidthHeuristic<T> Returns the width heuristic controlling the maximum number of nodes per layer.Methods inherited from interface org.ddolib.modeling.Model
debugMode, dominance, lowerBound, problem, upperBound, variableHeuristic, verbosityLevel
-
Method Details
-
relaxation
Relaxation<T> relaxation()Returns the relaxation of the model used to evaluate the nodes or layers of the decision diagram.The relaxation defines a simplified or approximate version of the problem, which helps bound the objective function or guide the search.
- Returns:
- the
Relaxationobject associated with this model
-
ranking
Returns the ranking function used to order states within a layer.The default implementation imposes no specific order (always returns 0), meaning all states are considered equal in priority. Override this method to implement problem-specific ranking heuristics.
- Returns:
- a
StateRankingcomparator between states
-
widthHeuristic
Returns the width heuristic controlling the maximum number of nodes per layer.The default implementation uses a fixed width of 10.
- Returns:
- a
WidthHeuristicinstance controlling diagram width
-
frontier
Returns the frontier management strategy used to store and expand the current layer of the decision diagram.The default implementation creates a
SimpleFrontierbased onranking()and usesCutSetType.LastExactLayeras the cut set.- Returns:
- a
Frontierinstance defining the search frontier
-
useCache
default boolean useCache()Indicates whether caching should be used during the diagram construction.Caching stores intermediate results to avoid redundant computations. By default, caching is disabled.
- Returns:
trueif caching is enabled,falseotherwise
-
exportDot
default boolean exportDot()Indicates whether the generated decision diagram should be exported to a DOT file (Graphviz format).This feature allows visualization of the structure of the generated decision diagram for debugging or analysis purposes. By default, export is disabled.
- Returns:
trueif DOT export is enabled,falseotherwise
-
relaxStrategy
Strategy to select which nodes should be merged together on a relaxed DD. -
restrictStrategy
Strategy to select which nodes should be dropped on a restricted DD. -
stateDistance
-
useLNS
default boolean useLNS() -
fixWidth
Returns a copy of this model but with a fixed width.- Parameters:
width- The maximum width of the diagram.- Returns:
- A copy of this model but with a fixed width.
-
setCutSetType
Returns a copy of this model by changing theCutSetType.- Parameters:
type- The new cutset type.- Returns:
- A copy of this model by changing the
CutSetType.
-
useCache
Returns a copy of this model by enabling or disabling the cache.- Parameters:
b- Whether the cache must be used.- Returns:
- A copy of this model by enabling or disabling the cache.
-
disableDominance
Description copied from interface:ModelReturns a copy of this model but without dominance.- Specified by:
disableDominancein interfaceModel<T>- Returns:
- A copy of this model but without dominance.
-
disableLowerBound
Description copied from interface:ModelReturns a copy of this model but withoutFastLowerBound.- Specified by:
disableLowerBoundin interfaceModel<T>- Returns:
- A copy of this model but without
FastLowerBound.
-
toExactModel
Convert this model into a model for the exact solver.- Returns:
- a model usable by an
ExactModel
-