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];
int
optional int32 branching_priority = 6 [default = 0];
static final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
boolean
True if the variable is constrained to be integer.double
lower_bound must be <= upper_bound.getName()
The name of the variable.com.google.protobuf.ByteString
The name of the variable.double
The coefficient of the variable in the objective.double
optional double upper_bound = 2 [default = inf];
boolean
optional int32 branching_priority = 6 [default = 0];
boolean
True if the variable is constrained to be integer.boolean
lower_bound must be <= upper_bound.boolean
hasName()
The name of the variable.boolean
The coefficient of the variable in the objective.boolean
optional double upper_bound = 2 [default = inf];
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
mergeFrom
(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, setUnknownFieldsProto3
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods 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:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
-
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<MPVariableProto.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in 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:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in 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:
hasLowerBound
in 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:
getLowerBound
in 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:
hasUpperBound
in interfaceMPVariableProtoOrBuilder
- Returns:
- Whether the upperBound field is set.
-
getUpperBound
public double getUpperBound()optional double upper_bound = 2 [default = inf];
- Specified by:
getUpperBound
in 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:
hasObjectiveCoefficient
in 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:
getObjectiveCoefficient
in 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:
hasIsInteger
in 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:
getIsInteger
in 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:
hasName
in interfaceMPVariableProtoOrBuilder
- Returns:
- Whether the name field is set.
-
getName
The name of the variable.
optional string name = 5 [default = ""];
- Specified by:
getName
in interfaceMPVariableProtoOrBuilder
- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The name of the variable.
optional string name = 5 [default = ""];
- Specified by:
getNameBytes
in 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:
hasBranchingPriority
in interfaceMPVariableProtoOrBuilder
- Returns:
- Whether the branchingPriority field is set.
-
getBranchingPriority
public int getBranchingPriority()optional int32 branching_priority = 6 [default = 0];
- Specified by:
getBranchingPriority
in 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.
-