public class CumulativeConstraint extends Constraint
This constraint allows adding (interval, demand) pairs to the cumulative constraint incrementally.
| Constructor and Description |
|---|
CumulativeConstraint(CpModel model) |
| Modifier and Type | Method and Description |
|---|---|
CumulativeConstraint |
addDemand(IntervalVar interval,
LinearArgument demand) |
CumulativeConstraint |
addDemand(IntervalVar interval,
long demand) |
CumulativeConstraint |
addDemands(IntervalVar[] intervals,
int[] demands)
Adds all pairs (intervals[i], demands[i]) to the constraint.
|
CumulativeConstraint |
addDemands(IntervalVar[] intervals,
LinearArgument[] demands)
Adds all pairs (intervals[i], demands[i]) to the constraint.
|
CumulativeConstraint |
addDemands(IntervalVar[] intervals,
long[] demands)
Adds all pairs (intervals[i], demands[i]) to the constraint.
|
getBuilder, getIndex, onlyEnforceIf, onlyEnforceIfpublic CumulativeConstraint(CpModel model)
public CumulativeConstraint addDemand(IntervalVar interval, LinearArgument demand)
public CumulativeConstraint addDemand(IntervalVar interval, long demand)
public CumulativeConstraint addDemands(IntervalVar[] intervals, LinearArgument[] demands)
intervals - an array of interval variablesdemands - an array of linear expressionCpModel.MismatchedArrayLengths - if intervals and demands have different lengthpublic CumulativeConstraint addDemands(IntervalVar[] intervals, long[] demands)
intervals - an array of interval variablesdemands - an array of long valuesCpModel.MismatchedArrayLengths - if intervals and demands have different lengthpublic CumulativeConstraint addDemands(IntervalVar[] intervals, int[] demands)
intervals - an array of interval variablesdemands - an array of integer valuesCpModel.MismatchedArrayLengths - if intervals and demands have different lengthCopyright © 2024. All rights reserved.