Class MPModelProto

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.ortools.linearsolver.MPModelProto
All Implemented Interfaces:
MPModelProtoOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

@Generated public final class MPModelProto extends com.google.protobuf.GeneratedMessage implements MPModelProtoOrBuilder
 MPModelProto contains all the information for a Linear Programming model.
 
Protobuf type operations_research.MPModelProto
See Also:
  • Field Details

    • VARIABLE_FIELD_NUMBER

      public static final int VARIABLE_FIELD_NUMBER
      See Also:
    • CONSTRAINT_FIELD_NUMBER

      public static final int CONSTRAINT_FIELD_NUMBER
      See Also:
    • GENERAL_CONSTRAINT_FIELD_NUMBER

      public static final int GENERAL_CONSTRAINT_FIELD_NUMBER
      See Also:
    • MAXIMIZE_FIELD_NUMBER

      public static final int MAXIMIZE_FIELD_NUMBER
      See Also:
    • OBJECTIVE_OFFSET_FIELD_NUMBER

      public static final int OBJECTIVE_OFFSET_FIELD_NUMBER
      See Also:
    • QUADRATIC_OBJECTIVE_FIELD_NUMBER

      public static final int QUADRATIC_OBJECTIVE_FIELD_NUMBER
      See Also:
    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • SOLUTION_HINT_FIELD_NUMBER

      public static final int SOLUTION_HINT_FIELD_NUMBER
      See Also:
    • ANNOTATION_FIELD_NUMBER

      public static final int ANNOTATION_FIELD_NUMBER
      See Also:
  • 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
    • getVariableList

      public List<MPVariableProto> getVariableList()
       All the variables appearing in the model.
       
      repeated .operations_research.MPVariableProto variable = 3;
      Specified by:
      getVariableList in interface MPModelProtoOrBuilder
    • getVariableOrBuilderList

      public List<? extends MPVariableProtoOrBuilder> getVariableOrBuilderList()
       All the variables appearing in the model.
       
      repeated .operations_research.MPVariableProto variable = 3;
      Specified by:
      getVariableOrBuilderList in interface MPModelProtoOrBuilder
    • getVariableCount

      public int getVariableCount()
       All the variables appearing in the model.
       
      repeated .operations_research.MPVariableProto variable = 3;
      Specified by:
      getVariableCount in interface MPModelProtoOrBuilder
    • getVariable

      public MPVariableProto getVariable(int index)
       All the variables appearing in the model.
       
      repeated .operations_research.MPVariableProto variable = 3;
      Specified by:
      getVariable in interface MPModelProtoOrBuilder
    • getVariableOrBuilder

      public MPVariableProtoOrBuilder getVariableOrBuilder(int index)
       All the variables appearing in the model.
       
      repeated .operations_research.MPVariableProto variable = 3;
      Specified by:
      getVariableOrBuilder in interface MPModelProtoOrBuilder
    • getConstraintList

      public List<MPConstraintProto> getConstraintList()
       All the constraints appearing in the model.
       
      repeated .operations_research.MPConstraintProto constraint = 4;
      Specified by:
      getConstraintList in interface MPModelProtoOrBuilder
    • getConstraintOrBuilderList

      public List<? extends MPConstraintProtoOrBuilder> getConstraintOrBuilderList()
       All the constraints appearing in the model.
       
      repeated .operations_research.MPConstraintProto constraint = 4;
      Specified by:
      getConstraintOrBuilderList in interface MPModelProtoOrBuilder
    • getConstraintCount

      public int getConstraintCount()
       All the constraints appearing in the model.
       
      repeated .operations_research.MPConstraintProto constraint = 4;
      Specified by:
      getConstraintCount in interface MPModelProtoOrBuilder
    • getConstraint

      public MPConstraintProto getConstraint(int index)
       All the constraints appearing in the model.
       
      repeated .operations_research.MPConstraintProto constraint = 4;
      Specified by:
      getConstraint in interface MPModelProtoOrBuilder
    • getConstraintOrBuilder

      public MPConstraintProtoOrBuilder getConstraintOrBuilder(int index)
       All the constraints appearing in the model.
       
      repeated .operations_research.MPConstraintProto constraint = 4;
      Specified by:
      getConstraintOrBuilder in interface MPModelProtoOrBuilder
    • getGeneralConstraintList

      public List<MPGeneralConstraintProto> getGeneralConstraintList()
       All the general constraints appearing in the model. Note that not all
       solvers support all types of general constraints.
       
      repeated .operations_research.MPGeneralConstraintProto general_constraint = 7;
      Specified by:
      getGeneralConstraintList in interface MPModelProtoOrBuilder
    • getGeneralConstraintOrBuilderList

      public List<? extends MPGeneralConstraintProtoOrBuilder> getGeneralConstraintOrBuilderList()
       All the general constraints appearing in the model. Note that not all
       solvers support all types of general constraints.
       
      repeated .operations_research.MPGeneralConstraintProto general_constraint = 7;
      Specified by:
      getGeneralConstraintOrBuilderList in interface MPModelProtoOrBuilder
    • getGeneralConstraintCount

      public int getGeneralConstraintCount()
       All the general constraints appearing in the model. Note that not all
       solvers support all types of general constraints.
       
      repeated .operations_research.MPGeneralConstraintProto general_constraint = 7;
      Specified by:
      getGeneralConstraintCount in interface MPModelProtoOrBuilder
    • getGeneralConstraint

      public MPGeneralConstraintProto getGeneralConstraint(int index)
       All the general constraints appearing in the model. Note that not all
       solvers support all types of general constraints.
       
      repeated .operations_research.MPGeneralConstraintProto general_constraint = 7;
      Specified by:
      getGeneralConstraint in interface MPModelProtoOrBuilder
    • getGeneralConstraintOrBuilder

      public MPGeneralConstraintProtoOrBuilder getGeneralConstraintOrBuilder(int index)
       All the general constraints appearing in the model. Note that not all
       solvers support all types of general constraints.
       
      repeated .operations_research.MPGeneralConstraintProto general_constraint = 7;
      Specified by:
      getGeneralConstraintOrBuilder in interface MPModelProtoOrBuilder
    • hasMaximize

      public boolean hasMaximize()
       True if the problem is a maximization problem. Minimize by default.
       
      optional bool maximize = 1 [default = false];
      Specified by:
      hasMaximize in interface MPModelProtoOrBuilder
      Returns:
      Whether the maximize field is set.
    • getMaximize

      public boolean getMaximize()
       True if the problem is a maximization problem. Minimize by default.
       
      optional bool maximize = 1 [default = false];
      Specified by:
      getMaximize in interface MPModelProtoOrBuilder
      Returns:
      The maximize.
    • hasObjectiveOffset

      public boolean hasObjectiveOffset()
       Offset for the objective function. Must be finite.
       
      optional double objective_offset = 2 [default = 0];
      Specified by:
      hasObjectiveOffset in interface MPModelProtoOrBuilder
      Returns:
      Whether the objectiveOffset field is set.
    • getObjectiveOffset

      public double getObjectiveOffset()
       Offset for the objective function. Must be finite.
       
      optional double objective_offset = 2 [default = 0];
      Specified by:
      getObjectiveOffset in interface MPModelProtoOrBuilder
      Returns:
      The objectiveOffset.
    • hasQuadraticObjective

      public boolean hasQuadraticObjective()
       Optionally, a quadratic objective.
       As of 2019/06, only SCIP and Gurobi support quadratic objectives.
       
      optional .operations_research.MPQuadraticObjective quadratic_objective = 8;
      Specified by:
      hasQuadraticObjective in interface MPModelProtoOrBuilder
      Returns:
      Whether the quadraticObjective field is set.
    • getQuadraticObjective

      public MPQuadraticObjective getQuadraticObjective()
       Optionally, a quadratic objective.
       As of 2019/06, only SCIP and Gurobi support quadratic objectives.
       
      optional .operations_research.MPQuadraticObjective quadratic_objective = 8;
      Specified by:
      getQuadraticObjective in interface MPModelProtoOrBuilder
      Returns:
      The quadraticObjective.
    • getQuadraticObjectiveOrBuilder

      public MPQuadraticObjectiveOrBuilder getQuadraticObjectiveOrBuilder()
       Optionally, a quadratic objective.
       As of 2019/06, only SCIP and Gurobi support quadratic objectives.
       
      optional .operations_research.MPQuadraticObjective quadratic_objective = 8;
      Specified by:
      getQuadraticObjectiveOrBuilder in interface MPModelProtoOrBuilder
    • hasName

      public boolean hasName()
       Name of the model.
       
      optional string name = 5 [default = ""];
      Specified by:
      hasName in interface MPModelProtoOrBuilder
      Returns:
      Whether the name field is set.
    • getName

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

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

      public boolean hasSolutionHint()
       Solution hint.
      
       If a feasible or almost-feasible solution to the problem is already known,
       it may be helpful to pass it to the solver so that it can be used. A solver
       that supports this feature will try to use this information to create its
       initial feasible solution.
      
       Note that it may not always be faster to give a hint like this to the
       solver. There is also no guarantee that the solver will use this hint or
       try to return a solution "close" to this assignment in case of multiple
       optimal solutions.
       
      optional .operations_research.PartialVariableAssignment solution_hint = 6;
      Specified by:
      hasSolutionHint in interface MPModelProtoOrBuilder
      Returns:
      Whether the solutionHint field is set.
    • getSolutionHint

      public PartialVariableAssignment getSolutionHint()
       Solution hint.
      
       If a feasible or almost-feasible solution to the problem is already known,
       it may be helpful to pass it to the solver so that it can be used. A solver
       that supports this feature will try to use this information to create its
       initial feasible solution.
      
       Note that it may not always be faster to give a hint like this to the
       solver. There is also no guarantee that the solver will use this hint or
       try to return a solution "close" to this assignment in case of multiple
       optimal solutions.
       
      optional .operations_research.PartialVariableAssignment solution_hint = 6;
      Specified by:
      getSolutionHint in interface MPModelProtoOrBuilder
      Returns:
      The solutionHint.
    • getSolutionHintOrBuilder

      public PartialVariableAssignmentOrBuilder getSolutionHintOrBuilder()
       Solution hint.
      
       If a feasible or almost-feasible solution to the problem is already known,
       it may be helpful to pass it to the solver so that it can be used. A solver
       that supports this feature will try to use this information to create its
       initial feasible solution.
      
       Note that it may not always be faster to give a hint like this to the
       solver. There is also no guarantee that the solver will use this hint or
       try to return a solution "close" to this assignment in case of multiple
       optimal solutions.
       
      optional .operations_research.PartialVariableAssignment solution_hint = 6;
      Specified by:
      getSolutionHintOrBuilder in interface MPModelProtoOrBuilder
    • getAnnotationList

      public List<MPModelProto.Annotation> getAnnotationList()
      repeated .operations_research.MPModelProto.Annotation annotation = 9;
      Specified by:
      getAnnotationList in interface MPModelProtoOrBuilder
    • getAnnotationOrBuilderList

      public List<? extends MPModelProto.AnnotationOrBuilder> getAnnotationOrBuilderList()
      repeated .operations_research.MPModelProto.Annotation annotation = 9;
      Specified by:
      getAnnotationOrBuilderList in interface MPModelProtoOrBuilder
    • getAnnotationCount

      public int getAnnotationCount()
      repeated .operations_research.MPModelProto.Annotation annotation = 9;
      Specified by:
      getAnnotationCount in interface MPModelProtoOrBuilder
    • getAnnotation

      public MPModelProto.Annotation getAnnotation(int index)
      repeated .operations_research.MPModelProto.Annotation annotation = 9;
      Specified by:
      getAnnotation in interface MPModelProtoOrBuilder
    • getAnnotationOrBuilder

      public MPModelProto.AnnotationOrBuilder getAnnotationOrBuilder(int index)
      repeated .operations_research.MPModelProto.Annotation annotation = 9;
      Specified by:
      getAnnotationOrBuilder in interface MPModelProtoOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static MPModelProto parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MPModelProto parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MPModelProto parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MPModelProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MPModelProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MPModelProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static MPModelProto parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MPModelProto parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static MPModelProto parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static MPModelProto parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MPModelProto parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static MPModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

      public MPModelProto.Builder newBuilderForType()
      Specified by:
      newBuilderForType in interface com.google.protobuf.Message
      Specified by:
      newBuilderForType in interface com.google.protobuf.MessageLite
    • newBuilder

      public static MPModelProto.Builder newBuilder()
    • newBuilder

      public static MPModelProto.Builder newBuilder(MPModelProto prototype)
    • toBuilder

      public MPModelProto.Builder toBuilder()
      Specified by:
      toBuilder in interface com.google.protobuf.Message
      Specified by:
      toBuilder in interface com.google.protobuf.MessageLite
    • newBuilderForType

      protected MPModelProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static MPModelProto getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<MPModelProto> parser()
    • getParserForType

      public com.google.protobuf.Parser<MPModelProto> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

      public MPModelProto getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder