java.lang.Object
org.maxicp.ModelDispatcher
- All Implemented Interfaces:
AutoCloseable,ModelProxyInstantiatorWithCP,ModelProxy,ModelProxyInstantiator
public class ModelDispatcher
extends Object
implements ModelProxyInstantiator, AutoCloseable, ModelProxyInstantiatorWithCP, ModelProxy
A class that allows to create symbolic models
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.maxicp.modeling.ModelProxy
ModelProxy.NotConcreteExceptionNested classes/interfaces inherited from interface org.maxicp.modeling.ModelProxyInstantiator
ModelProxyInstantiator.ModelInstantiator<T extends ConcreteModel> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariableGroup(List<IntExpression> group) <U extends Comparable<U>>
BestFirstSearch<U> bestFirstSearch(Supplier<Runnable[]> branching, Supplier<U> nodeEvaluator) boolVar()BoolVar[]boolVarArray(int n) voidclose()concurrentDFSearch(Supplier<SymbolicModel[]> symbolicBranching) constant(int value) Shortcut for baseModel.getModel().getConstraints();Infers the decision variables from the constraint graph of the current model.getModel()intervalVar(boolean isPresent) intervalVar(int duration, boolean isPresent) intervalVar(int startMin, int endMax, int duration, boolean isPresent) intervalVar(int startMin, int startMax, int endMin, int endMax, int lengthMin, int lengthMax, boolean isPresent) intervalVarArray(int n, boolean present) intervalVarArray(int n, Function<Integer, IntervalVar> body) intVar(int[] values) intVar(int min, int max) IntVar[]intVarArray(int n, int domSize) Create an array of n IntVars with domain between 0 and domSize-1, inclusive.intVarArray(int n, Function<Integer, IntExpression> body) seqVar(int nNode, int begin, int end) <T extends Model>
TsetModel(T m) Set the current model to m. m should have this base model as origin.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.maxicp.modeling.ModelProxy
add, add, add, add, fixpoint, getConcreteModel, getSymbolicModel, isConcrete, isSymbolic, runWithModel, runWithModelMethods inherited from interface org.maxicp.modeling.ModelProxyInstantiator
instantiate, runAsConcrete, runAsConcrete, runAsConcrete, runAsConcrete, runAsConcrete, runAsConcrete, runAsConcrete, runAsConcreteMethods inherited from interface org.maxicp.cp.modeling.ModelProxyInstantiatorWithCP
cpInstantiate, runCP, runCP, runCP, runCP, runCP, runCP, runCP, runCP
-
Constructor Details
-
ModelDispatcher
public ModelDispatcher()
-
-
Method Details
-
getModel
- Specified by:
getModelin interfaceModelProxy- Returns:
- the current model
-
setModel
Set the current model to m. m should have this base model as origin.- Specified by:
setModelin interfaceModelProxy- Parameters:
m-
-
getConstraints
Shortcut for baseModel.getModel().getConstraints();- Returns:
- an iterable with all the constraints in the current model
-
getDecisionVariables
Infers the decision variables from the constraint graph of the current model.A variable is considered a decision variable when it appears as an "index / choice" argument in a constraint or expression that implements
DecisionVarsProvider. Examples: the index variable of anElement1D/2Dexpression, or any variable in the scope of anAllDifferent,Circuit,Table, etc.Only leaf
IntVarinstances are returned – derived expressions (sums, element results, views) are always excluded.The returned list is ordered by first-seen occurrence during a depth-first walk of the constraint graph and contains no duplicates (identity-based).
- Returns:
- unmodifiable list of candidate decision variables
- See Also:
-
intVarArray
Create an array of n IntVars with domain between 0 and domSize-1, inclusive.- Parameters:
n- size of the array, number of IntVarsdomSize- size of the domains. Domains are [0, domsize-1]
-
intVarArray
-
intVar
-
intVar
-
intVar
-
intVar
-
intVar
-
constant
-
intervalVar
public IntervalVar intervalVar(int startMin, int startMax, int endMin, int endMax, int lengthMin, int lengthMax, boolean isPresent) -
intervalVar
-
intervalVar
-
intervalVar
-
intervalVarArray
-
intervalVarArray
-
boolVarArray
-
boolVar
-
seqVar
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
minimize
-
maximize
-
dfSearch
-
concurrentDFSearch
-
bestFirstSearch
public <U extends Comparable<U>> BestFirstSearch<U> bestFirstSearch(Supplier<Runnable[]> branching, Supplier<U> nodeEvaluator) -
addVariableGroup
-