java.lang.Object
org.maxicp.cp.engine.core.AbstractCPConstraint
org.maxicp.cp.engine.constraints.Sum
- All Implemented Interfaces:
CPConstraint,ConcreteConstraint<ConcreteCPModel>
Sum Constraint
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.maxicp.cp.engine.core.AbstractCPConstraint
getSolver, isActive, isScheduled, priority, registerDelta, setActive, setScheduled, updateDeltas
-
Constructor Details
-
Sum
Creates a sum constraint.This constraint holds iff
x[0]+x[1]+...+x[x.length-1] == y.- Parameters:
x- the non-empty left hand side of the sumy- the right hand side of the sum
-
Sum
Creates a sum constraint.This constraint holds iff
x[0]+x[1]+...+x[x.length-1] == y.- Parameters:
x- the non empty left hand side of the sumy- the right hand side of the sum
-
Sum
Creates a sum constraint.This constraint holds iff
x[0]+x[1]+...+x[x.length-1] == 0.- Parameters:
x- the non empty set of variables that should sum to zero
-
-
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
-