Class MPVariableProto.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<MPVariableProto.Builder>
com.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
com.google.ortools.linearsolver.MPVariableProto.Builder
- All Implemented Interfaces:
MPVariableProtoOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
MPVariableProto
public static final class MPVariableProto.Builder
extends com.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
implements MPVariableProtoOrBuilder
A variable is always constrained in the form: lower_bound <= x <= upper_bound where lower_bound and upper_bound: - Can form a singleton: x = constant = lower_bound = upper_bound. - Can form a finite interval: lower_bound <= x <= upper_bound. (x is boxed.) - Can form a semi-infinite interval. - lower_bound = -infinity: x <= upper_bound. - upper_bound = +infinity: x >= lower_bound. - Can form the infinite interval: lower_bound = -infinity and upper_bound = +infinity, x is free. MPVariableProto furthermore stores: - The coefficient of the variable in the objective. - Whether the variable is integer.Protobuf type
operations_research.MPVariableProto-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()optional int32 branching_priority = 6 [default = 0];True if the variable is constrained to be integer.lower_bound must be <= upper_bound.The name of the variable.The coefficient of the variable in the objective.optional double upper_bound = 2 [default = inf];intoptional int32 branching_priority = 6 [default = 0];static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanTrue if the variable is constrained to be integer.doublelower_bound must be <= upper_bound.getName()The name of the variable.com.google.protobuf.ByteStringThe name of the variable.doubleThe coefficient of the variable in the objective.doubleoptional double upper_bound = 2 [default = inf];booleanoptional int32 branching_priority = 6 [default = 0];booleanTrue if the variable is constrained to be integer.booleanlower_bound must be <= upper_bound.booleanhasName()The name of the variable.booleanThe coefficient of the variable in the objective.booleanoptional double upper_bound = 2 [default = inf];protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(MPVariableProto other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setBranchingPriority(int value) optional int32 branching_priority = 6 [default = 0];setIsInteger(boolean value) True if the variable is constrained to be integer.setLowerBound(double value) lower_bound must be <= upper_bound.The name of the variable.setNameBytes(com.google.protobuf.ByteString value) The name of the variable.setObjectiveCoefficient(double value) The coefficient of the variable in the objective.setUpperBound(double value) optional double upper_bound = 2 [default = inf];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<MPVariableProto.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<MPVariableProto.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<MPVariableProto.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<MPVariableProto.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
-
mergeFrom
public MPVariableProto.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<MPVariableProto.Builder>- Throws:
IOException
-
hasLowerBound
public boolean hasLowerBound()lower_bound must be <= upper_bound.
optional double lower_bound = 1 [default = -inf];- Specified by:
hasLowerBoundin interfaceMPVariableProtoOrBuilder- Returns:
- Whether the lowerBound field is set.
-
getLowerBound
public double getLowerBound()lower_bound must be <= upper_bound.
optional double lower_bound = 1 [default = -inf];- Specified by:
getLowerBoundin interfaceMPVariableProtoOrBuilder- Returns:
- The lowerBound.
-
setLowerBound
lower_bound must be <= upper_bound.
optional double lower_bound = 1 [default = -inf];- Parameters:
value- The lowerBound to set.- Returns:
- This builder for chaining.
-
clearLowerBound
lower_bound must be <= upper_bound.
optional double lower_bound = 1 [default = -inf];- Returns:
- This builder for chaining.
-
hasUpperBound
public boolean hasUpperBound()optional double upper_bound = 2 [default = inf];- Specified by:
hasUpperBoundin interfaceMPVariableProtoOrBuilder- Returns:
- Whether the upperBound field is set.
-
getUpperBound
public double getUpperBound()optional double upper_bound = 2 [default = inf];- Specified by:
getUpperBoundin interfaceMPVariableProtoOrBuilder- Returns:
- The upperBound.
-
setUpperBound
optional double upper_bound = 2 [default = inf];- Parameters:
value- The upperBound to set.- Returns:
- This builder for chaining.
-
clearUpperBound
optional double upper_bound = 2 [default = inf];- Returns:
- This builder for chaining.
-
hasObjectiveCoefficient
public boolean hasObjectiveCoefficient()The coefficient of the variable in the objective. Must be finite.
optional double objective_coefficient = 3 [default = 0];- Specified by:
hasObjectiveCoefficientin interfaceMPVariableProtoOrBuilder- Returns:
- Whether the objectiveCoefficient field is set.
-
getObjectiveCoefficient
public double getObjectiveCoefficient()The coefficient of the variable in the objective. Must be finite.
optional double objective_coefficient = 3 [default = 0];- Specified by:
getObjectiveCoefficientin interfaceMPVariableProtoOrBuilder- Returns:
- The objectiveCoefficient.
-
setObjectiveCoefficient
The coefficient of the variable in the objective. Must be finite.
optional double objective_coefficient = 3 [default = 0];- Parameters:
value- The objectiveCoefficient to set.- Returns:
- This builder for chaining.
-
clearObjectiveCoefficient
The coefficient of the variable in the objective. Must be finite.
optional double objective_coefficient = 3 [default = 0];- Returns:
- This builder for chaining.
-
hasIsInteger
public boolean hasIsInteger()True if the variable is constrained to be integer. Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
optional bool is_integer = 4 [default = false];- Specified by:
hasIsIntegerin interfaceMPVariableProtoOrBuilder- Returns:
- Whether the isInteger field is set.
-
getIsInteger
public boolean getIsInteger()True if the variable is constrained to be integer. Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
optional bool is_integer = 4 [default = false];- Specified by:
getIsIntegerin interfaceMPVariableProtoOrBuilder- Returns:
- The isInteger.
-
setIsInteger
True if the variable is constrained to be integer. Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
optional bool is_integer = 4 [default = false];- Parameters:
value- The isInteger to set.- Returns:
- This builder for chaining.
-
clearIsInteger
True if the variable is constrained to be integer. Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.
optional bool is_integer = 4 [default = false];- Returns:
- This builder for chaining.
-
hasName
public boolean hasName()The name of the variable.
optional string name = 5 [default = ""];- Specified by:
hasNamein interfaceMPVariableProtoOrBuilder- Returns:
- Whether the name field is set.
-
getName
The name of the variable.
optional string name = 5 [default = ""];- Specified by:
getNamein interfaceMPVariableProtoOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The name of the variable.
optional string name = 5 [default = ""];- Specified by:
getNameBytesin interfaceMPVariableProtoOrBuilder- Returns:
- The bytes for name.
-
setName
The name of the variable.
optional string name = 5 [default = ""];- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
The name of the variable.
optional string name = 5 [default = ""];- Returns:
- This builder for chaining.
-
setNameBytes
The name of the variable.
optional string name = 5 [default = ""];- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
hasBranchingPriority
public boolean hasBranchingPriority()optional int32 branching_priority = 6 [default = 0];- Specified by:
hasBranchingPriorityin interfaceMPVariableProtoOrBuilder- Returns:
- Whether the branchingPriority field is set.
-
getBranchingPriority
public int getBranchingPriority()optional int32 branching_priority = 6 [default = 0];- Specified by:
getBranchingPriorityin interfaceMPVariableProtoOrBuilder- Returns:
- The branchingPriority.
-
setBranchingPriority
optional int32 branching_priority = 6 [default = 0];- Parameters:
value- The branchingPriority to set.- Returns:
- This builder for chaining.
-
clearBranchingPriority
optional int32 branching_priority = 6 [default = 0];- Returns:
- This builder for chaining.
-