public class Sum extends AbstractConstraint
| Constructor and Description |
|---|
Sum(IntVar[] x)
Creates a sum constraint.
|
Sum(IntVar[] x,
int y)
Creates a sum constraint.
|
Sum(IntVar[] x,
IntVar y)
Creates a sum constraint.
|
| Modifier and Type | Method and Description |
|---|---|
void |
post()
Initializes the constraint when it is posted to the solver.
|
void |
propagate()
Propagates the constraint.
|
getSolver, isActive, isScheduled, setActive, setScheduledpublic Sum(IntVar[] x, IntVar y)
This constraint holds iff
x[0]+x[1]+...+x[x.length-1] == y.
x - the non empty left hand side of the sumy - the right hand side of the sumpublic Sum(IntVar[] x, int y)
This constraint holds iff
x[0]+x[1]+...+x[x.length-1] == y.
x - the non empty left hand side of the sumy - the right hand side of the sumpublic Sum(IntVar[] x)
This constraint holds iff
x[0]+x[1]+...+x[x.length-1] == 0.
x - the non empty set of variables that should sum to zeropublic void post()
Constraintpost in interface Constraintpost in class AbstractConstraintpublic void propagate()
Constraintpropagate in interface Constraintpropagate in class AbstractConstraintCopyright © 2018 Laurent Michel, Pierre Schaus, Pascal Van Hentenryck. All rights reserved.