Class MPModelProto

  • All Implemented Interfaces:
    MPModelProtoOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.io.Serializable

    public final class MPModelProto
    extends com.google.protobuf.GeneratedMessageV3
    implements MPModelProtoOrBuilder
     MPModelProto contains all the information for a Linear Programming model.
     
    Protobuf type operations_research.MPModelProto
    See Also:
    Serialized Form
    • Field Detail

      • CONSTRAINT_FIELD_NUMBER

        public static final int CONSTRAINT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • GENERAL_CONSTRAINT_FIELD_NUMBER

        public static final int GENERAL_CONSTRAINT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • OBJECTIVE_OFFSET_FIELD_NUMBER

        public static final int OBJECTIVE_OFFSET_FIELD_NUMBER
        See Also:
        Constant Field Values
      • QUADRATIC_OBJECTIVE_FIELD_NUMBER

        public static final int QUADRATIC_OBJECTIVE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SOLUTION_HINT_FIELD_NUMBER

        public static final int SOLUTION_HINT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ANNOTATION_FIELD_NUMBER

        public static final int ANNOTATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PARSER

        @Deprecated
        public static final com.google.protobuf.Parser<MPModelProto> PARSER
        Deprecated.
    • Method Detail

      • newInstance

        protected java.lang.Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getVariableCount

        public int getVariableCount()
         All the variables appearing in the model.
         
        repeated .operations_research.MPVariableProto variable = 3;
        Specified by:
        getVariableCount 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
      • getGeneralConstraintList

        public java.util.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
      • 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
      • 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.
      • 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 java.lang.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
      • isInitialized

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

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

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

        public boolean equals​(java.lang.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​(java.nio.ByteBuffer data)
                                      throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static MPModelProto parseFrom​(java.nio.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​(java.io.InputStream input)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

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

        public static MPModelProto parseDelimitedFrom​(java.io.InputStream input)
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

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

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

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

        public MPModelProto.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • 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.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
      • getDefaultInstanceForType

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