Class CumulativeConstraintProto.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<CumulativeConstraintProto.Builder>
com.google.protobuf.GeneratedMessage.Builder<CumulativeConstraintProto.Builder>
com.google.ortools.sat.CumulativeConstraintProto.Builder
- All Implemented Interfaces:
CumulativeConstraintProtoOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
CumulativeConstraintProto
public static final class CumulativeConstraintProto.Builder
extends com.google.protobuf.GeneratedMessage.Builder<CumulativeConstraintProto.Builder>
implements CumulativeConstraintProtoOrBuilder
The sum of the demands of the intervals at each interval point cannot exceed a capacity. Note that intervals are interpreted as [start, end) and as such intervals like [2,3) and [3,4) do not overlap for the point of view of this constraint. Moreover, intervals of size zero are ignored. All demands must not contain any negative value in their domains. This is checked at validation. Even if there are no intervals, this constraint implicit enforces capacity >= 0. In other words, a negative capacity is considered valid but always infeasible.Protobuf type
operations_research.sat.CumulativeConstraintProto-
Method Summary
Modifier and TypeMethodDescriptionaddAllDemands(Iterable<? extends LinearExpressionProto> values) Same size as intervals.addAllIntervals(Iterable<? extends Integer> values) repeated int32 intervals = 2;addDemands(int index, LinearExpressionProto value) Same size as intervals.addDemands(int index, LinearExpressionProto.Builder builderForValue) Same size as intervals.addDemands(LinearExpressionProto value) Same size as intervals.addDemands(LinearExpressionProto.Builder builderForValue) Same size as intervals.Same size as intervals.addDemandsBuilder(int index) Same size as intervals.addIntervals(int value) repeated int32 intervals = 2;build()clear().operations_research.sat.LinearExpressionProto capacity = 1;Same size as intervals.repeated int32 intervals = 2;.operations_research.sat.LinearExpressionProto capacity = 1;.operations_research.sat.LinearExpressionProto capacity = 1;.operations_research.sat.LinearExpressionProto capacity = 1;getDemands(int index) Same size as intervals.getDemandsBuilder(int index) Same size as intervals.Same size as intervals.intSame size as intervals.Same size as intervals.getDemandsOrBuilder(int index) Same size as intervals.List<? extends LinearExpressionProtoOrBuilder> Same size as intervals.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorintgetIntervals(int index) repeated int32 intervals = 2;intrepeated int32 intervals = 2;repeated int32 intervals = 2;boolean.operations_research.sat.LinearExpressionProto capacity = 1;protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal boolean.operations_research.sat.LinearExpressionProto capacity = 1;mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) removeDemands(int index) Same size as intervals.setCapacity(LinearExpressionProto value) .operations_research.sat.LinearExpressionProto capacity = 1;setCapacity(LinearExpressionProto.Builder builderForValue) .operations_research.sat.LinearExpressionProto capacity = 1;setDemands(int index, LinearExpressionProto value) Same size as intervals.setDemands(int index, LinearExpressionProto.Builder builderForValue) Same size as intervals.setIntervals(int index, int value) repeated int32 intervals = 2;Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<CumulativeConstraintProto.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<CumulativeConstraintProto.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<CumulativeConstraintProto.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CumulativeConstraintProto.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<CumulativeConstraintProto.Builder>
-
mergeFrom
public CumulativeConstraintProto.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CumulativeConstraintProto.Builder>- Throws:
IOException
-
hasCapacity
public boolean hasCapacity().operations_research.sat.LinearExpressionProto capacity = 1;- Specified by:
hasCapacityin interfaceCumulativeConstraintProtoOrBuilder- Returns:
- Whether the capacity field is set.
-
getCapacity
.operations_research.sat.LinearExpressionProto capacity = 1;- Specified by:
getCapacityin interfaceCumulativeConstraintProtoOrBuilder- Returns:
- The capacity.
-
setCapacity
.operations_research.sat.LinearExpressionProto capacity = 1; -
setCapacity
.operations_research.sat.LinearExpressionProto capacity = 1; -
mergeCapacity
.operations_research.sat.LinearExpressionProto capacity = 1; -
clearCapacity
.operations_research.sat.LinearExpressionProto capacity = 1; -
getCapacityBuilder
.operations_research.sat.LinearExpressionProto capacity = 1; -
getCapacityOrBuilder
.operations_research.sat.LinearExpressionProto capacity = 1;- Specified by:
getCapacityOrBuilderin interfaceCumulativeConstraintProtoOrBuilder
-
getIntervalsList
repeated int32 intervals = 2;- Specified by:
getIntervalsListin interfaceCumulativeConstraintProtoOrBuilder- Returns:
- A list containing the intervals.
-
getIntervalsCount
public int getIntervalsCount()repeated int32 intervals = 2;- Specified by:
getIntervalsCountin interfaceCumulativeConstraintProtoOrBuilder- Returns:
- The count of intervals.
-
getIntervals
public int getIntervals(int index) repeated int32 intervals = 2;- Specified by:
getIntervalsin interfaceCumulativeConstraintProtoOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The intervals at the given index.
-
setIntervals
repeated int32 intervals = 2;- Parameters:
index- The index to set the value at.value- The intervals to set.- Returns:
- This builder for chaining.
-
addIntervals
repeated int32 intervals = 2;- Parameters:
value- The intervals to add.- Returns:
- This builder for chaining.
-
addAllIntervals
repeated int32 intervals = 2;- Parameters:
values- The intervals to add.- Returns:
- This builder for chaining.
-
clearIntervals
repeated int32 intervals = 2;- Returns:
- This builder for chaining.
-
getDemandsList
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3;- Specified by:
getDemandsListin interfaceCumulativeConstraintProtoOrBuilder
-
getDemandsCount
public int getDemandsCount()Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3;- Specified by:
getDemandsCountin interfaceCumulativeConstraintProtoOrBuilder
-
getDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3;- Specified by:
getDemandsin interfaceCumulativeConstraintProtoOrBuilder
-
setDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
setDemands
public CumulativeConstraintProto.Builder setDemands(int index, LinearExpressionProto.Builder builderForValue) Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
addDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
addDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
addDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
addDemands
public CumulativeConstraintProto.Builder addDemands(int index, LinearExpressionProto.Builder builderForValue) Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
addAllDemands
public CumulativeConstraintProto.Builder addAllDemands(Iterable<? extends LinearExpressionProto> values) Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
clearDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
removeDemands
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
getDemandsBuilder
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
getDemandsOrBuilder
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3;- Specified by:
getDemandsOrBuilderin interfaceCumulativeConstraintProtoOrBuilder
-
getDemandsOrBuilderList
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3;- Specified by:
getDemandsOrBuilderListin interfaceCumulativeConstraintProtoOrBuilder
-
addDemandsBuilder
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
addDemandsBuilder
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3; -
getDemandsBuilderList
Same size as intervals.
repeated .operations_research.sat.LinearExpressionProto demands = 3;
-