Package minicp.engine.constraints
Class Sum
java.lang.Object
minicp.engine.core.AbstractConstraint
minicp.engine.constraints.Sum
- All Implemented Interfaces:
Constraint
Sum Constraint
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class minicp.engine.core.AbstractConstraint
getSolver, isActive, isScheduled, setActive, setScheduled
-
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:ConstraintInitializes the constraint when it is posted to the solver.- Specified by:
postin interfaceConstraint- Overrides:
postin classAbstractConstraint
-
propagate
public void propagate()Description copied from interface:ConstraintPropagates the constraint.- Specified by:
propagatein interfaceConstraint- Overrides:
propagatein classAbstractConstraint
-