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 Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
    • clear

      public MPVariableProto.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<MPVariableProto.Builder>
    • getDefaultInstanceForType

      public MPVariableProto getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public MPVariableProto build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public MPVariableProto buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public MPVariableProto.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<MPVariableProto.Builder>
    • mergeFrom

      public MPVariableProto.Builder mergeFrom(MPVariableProto other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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 interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.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 interface MPVariableProtoOrBuilder
      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 interface MPVariableProtoOrBuilder
      Returns:
      The lowerBound.
    • setLowerBound

      public MPVariableProto.Builder setLowerBound(double value)
       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

      public MPVariableProto.Builder 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 interface MPVariableProtoOrBuilder
      Returns:
      Whether the upperBound field is set.
    • getUpperBound

      public double getUpperBound()
      optional double upper_bound = 2 [default = inf];
      Specified by:
      getUpperBound in interface MPVariableProtoOrBuilder
      Returns:
      The upperBound.
    • setUpperBound

      public MPVariableProto.Builder setUpperBound(double value)
      optional double upper_bound = 2 [default = inf];
      Parameters:
      value - The upperBound to set.
      Returns:
      This builder for chaining.
    • clearUpperBound

      public MPVariableProto.Builder 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 interface MPVariableProtoOrBuilder
      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 interface MPVariableProtoOrBuilder
      Returns:
      The objectiveCoefficient.
    • setObjectiveCoefficient

      public MPVariableProto.Builder setObjectiveCoefficient(double value)
       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

      public MPVariableProto.Builder 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 interface MPVariableProtoOrBuilder
      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 interface MPVariableProtoOrBuilder
      Returns:
      The isInteger.
    • setIsInteger

      public MPVariableProto.Builder setIsInteger(boolean value)
       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

      public MPVariableProto.Builder 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 interface MPVariableProtoOrBuilder
      Returns:
      Whether the name field is set.
    • getName

      public String getName()
       The name of the variable.
       
      optional string name = 5 [default = ""];
      Specified by:
      getName in interface MPVariableProtoOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       The name of the variable.
       
      optional string name = 5 [default = ""];
      Specified by:
      getNameBytes in interface MPVariableProtoOrBuilder
      Returns:
      The bytes for name.
    • setName

      public MPVariableProto.Builder setName(String value)
       The name of the variable.
       
      optional string name = 5 [default = ""];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public MPVariableProto.Builder clearName()
       The name of the variable.
       
      optional string name = 5 [default = ""];
      Returns:
      This builder for chaining.
    • setNameBytes

      public MPVariableProto.Builder setNameBytes(com.google.protobuf.ByteString value)
       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 interface MPVariableProtoOrBuilder
      Returns:
      Whether the branchingPriority field is set.
    • getBranchingPriority

      public int getBranchingPriority()
      optional int32 branching_priority = 6 [default = 0];
      Specified by:
      getBranchingPriority in interface MPVariableProtoOrBuilder
      Returns:
      The branchingPriority.
    • setBranchingPriority

      public MPVariableProto.Builder setBranchingPriority(int value)
      optional int32 branching_priority = 6 [default = 0];
      Parameters:
      value - The branchingPriority to set.
      Returns:
      This builder for chaining.
    • clearBranchingPriority

      public MPVariableProto.Builder clearBranchingPriority()
      optional int32 branching_priority = 6 [default = 0];
      Returns:
      This builder for chaining.