14package com.google.ortools.sat;
16import com.google.ortools.sat.CumulativeConstraintProto;
24public class CumulativeConstraint
extends Constraint {
32 CumulativeConstraintProto.Builder cumul =
getBuilder().getCumulativeBuilder();
33 cumul.addIntervals(interval.
getIndex());
34 cumul.addDemands(model.getLinearExpressionProtoBuilderFromLinearArgument(demand,
false));
40 CumulativeConstraintProto.Builder cumul =
getBuilder().getCumulativeBuilder();
41 cumul.addIntervals(interval.
getIndex());
42 cumul.addDemands(model.getLinearExpressionProtoBuilderFromLong(demand));
55 if (intervals.length != demands.length) {
57 "CumulativeConstraint.addDemands",
"intervals",
"demands");
59 for (
int i = 0; i < intervals.length; i++) {
74 if (intervals.length != demands.length) {
76 "CumulativeConstraint.addDemands",
"intervals",
"demands");
78 for (
int i = 0; i < intervals.length; i++) {
93 if (intervals.length != demands.length) {
95 "CumulativeConstraint.addDemands",
"intervals",
"demands");
97 for (
int i = 0; i < intervals.length; i++) {