java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.Element1DVar
- All Implemented Interfaces:
CPConstraint,ConcreteConstraint<ConcreteCPModel>
Element Constraint over an array of variables, modeling
array[y] = z.-
Constructor Summary
ConstructorsConstructorDescriptionElement1DVar(CPIntVar[] array, CPIntVar y, CPIntVar z) Creates an element constraintarray[y] = zwherearrayis an array of integer variables. -
Method Summary
Methods inherited from class org.maxicp.cp.engine.core.AbstractCPConstraint
getSolver, isActive, isScheduled, priority, registerDelta, setActive, setScheduled, updateDeltas
-
Constructor Details
-
Element1DVar
Creates an element constraintarray[y] = zwherearrayis an array of integer variables.- Parameters:
array- the array of variables to indexy- the index variablez- the result variable
-
-
Method Details
-
post
public void post()Description copied from interface:CPConstraintInitializes the constraint when it is posted to the solver.- Specified by:
postin interfaceCPConstraint- Overrides:
postin classAbstractCPConstraint
-
propagate
public void propagate()Description copied from interface:CPConstraintPropagates the constraint.- Specified by:
propagatein interfaceCPConstraint- Overrides:
propagatein classAbstractCPConstraint
-