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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Annotations can be freely added by users who want to attach arbitrary payload to the model's variables or constraints.static interface
static final class
MPModelProto contains all the information for a Linear Programming model.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>, BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,
BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParent
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFields
Fields inherited from class com.google.protobuf.AbstractMessage
memoizedSize
Fields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getAnnotation
(int index) repeated .operations_research.MPModelProto.Annotation annotation = 9;
int
repeated .operations_research.MPModelProto.Annotation annotation = 9;
repeated .operations_research.MPModelProto.Annotation annotation = 9;
getAnnotationOrBuilder
(int index) repeated .operations_research.MPModelProto.Annotation annotation = 9;
List
<? extends MPModelProto.AnnotationOrBuilder> repeated .operations_research.MPModelProto.Annotation annotation = 9;
getConstraint
(int index) All the constraints appearing in the model.int
All the constraints appearing in the model.All the constraints appearing in the model.getConstraintOrBuilder
(int index) All the constraints appearing in the model.List
<? extends MPConstraintProtoOrBuilder> All the constraints appearing in the model.static MPModelProto
static final com.google.protobuf.Descriptors.Descriptor
getGeneralConstraint
(int index) All the general constraints appearing in the model.int
All the general constraints appearing in the model.All the general constraints appearing in the model.getGeneralConstraintOrBuilder
(int index) All the general constraints appearing in the model.List
<? extends MPGeneralConstraintProtoOrBuilder> All the general constraints appearing in the model.boolean
True if the problem is a maximization problem.getName()
Name of the model.com.google.protobuf.ByteString
Name of the model.double
Offset for the objective function.com.google.protobuf.Parser
<MPModelProto> Optionally, a quadratic objective.Optionally, a quadratic objective.int
Solution hint.Solution hint.getVariable
(int index) All the variables appearing in the model.int
All the variables appearing in the model.All the variables appearing in the model.getVariableOrBuilder
(int index) All the variables appearing in the model.List
<? extends MPVariableProtoOrBuilder> All the variables appearing in the model.int
hashCode()
boolean
True if the problem is a maximization problem.boolean
hasName()
Name of the model.boolean
Offset for the objective function.boolean
Optionally, a quadratic objective.boolean
Solution hint.protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
final boolean
static MPModelProto.Builder
static MPModelProto.Builder
newBuilder
(MPModelProto prototype) protected MPModelProto.Builder
newBuilderForType
(com.google.protobuf.AbstractMessage.BuilderParent parent) static MPModelProto
parseDelimitedFrom
(InputStream input) static MPModelProto
parseDelimitedFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProto
parseFrom
(byte[] data) static MPModelProto
parseFrom
(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProto
parseFrom
(com.google.protobuf.ByteString data) static MPModelProto
parseFrom
(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProto
parseFrom
(com.google.protobuf.CodedInputStream input) static MPModelProto
parseFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProto
parseFrom
(InputStream input) static MPModelProto
parseFrom
(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProto
parseFrom
(ByteBuffer data) static MPModelProto
parseFrom
(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser
<MPModelProto> parser()
void
writeTo
(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeTo
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
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 classcom.google.protobuf.GeneratedMessage
-
getVariableList
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;
- Specified by:
getVariableList
in interfaceMPModelProtoOrBuilder
-
getVariableOrBuilderList
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;
- Specified by:
getVariableOrBuilderList
in interfaceMPModelProtoOrBuilder
-
getVariableCount
public int getVariableCount()All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;
- Specified by:
getVariableCount
in interfaceMPModelProtoOrBuilder
-
getVariable
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;
- Specified by:
getVariable
in interfaceMPModelProtoOrBuilder
-
getVariableOrBuilder
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;
- Specified by:
getVariableOrBuilder
in interfaceMPModelProtoOrBuilder
-
getConstraintList
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;
- Specified by:
getConstraintList
in interfaceMPModelProtoOrBuilder
-
getConstraintOrBuilderList
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;
- Specified by:
getConstraintOrBuilderList
in interfaceMPModelProtoOrBuilder
-
getConstraintCount
public int getConstraintCount()All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;
- Specified by:
getConstraintCount
in interfaceMPModelProtoOrBuilder
-
getConstraint
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;
- Specified by:
getConstraint
in interfaceMPModelProtoOrBuilder
-
getConstraintOrBuilder
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;
- Specified by:
getConstraintOrBuilder
in interfaceMPModelProtoOrBuilder
-
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 interfaceMPModelProtoOrBuilder
-
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 interfaceMPModelProtoOrBuilder
-
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 interfaceMPModelProtoOrBuilder
-
getGeneralConstraint
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 interfaceMPModelProtoOrBuilder
-
getGeneralConstraintOrBuilder
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 interfaceMPModelProtoOrBuilder
-
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 interfaceMPModelProtoOrBuilder
- 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 interfaceMPModelProtoOrBuilder
- 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 interfaceMPModelProtoOrBuilder
- 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 interfaceMPModelProtoOrBuilder
- 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 interfaceMPModelProtoOrBuilder
- Returns:
- Whether the quadraticObjective field is set.
-
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 interfaceMPModelProtoOrBuilder
- Returns:
- The quadraticObjective.
-
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 interfaceMPModelProtoOrBuilder
-
hasName
public boolean hasName()Name of the model.
optional string name = 5 [default = ""];
- Specified by:
hasName
in interfaceMPModelProtoOrBuilder
- Returns:
- Whether the name field is set.
-
getName
Name of the model.
optional string name = 5 [default = ""];
- Specified by:
getName
in interfaceMPModelProtoOrBuilder
- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()Name of the model.
optional string name = 5 [default = ""];
- Specified by:
getNameBytes
in interfaceMPModelProtoOrBuilder
- 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 interfaceMPModelProtoOrBuilder
- Returns:
- Whether the solutionHint field is set.
-
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 interfaceMPModelProtoOrBuilder
- Returns:
- The solutionHint.
-
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 interfaceMPModelProtoOrBuilder
-
getAnnotationList
repeated .operations_research.MPModelProto.Annotation annotation = 9;
- Specified by:
getAnnotationList
in interfaceMPModelProtoOrBuilder
-
getAnnotationOrBuilderList
repeated .operations_research.MPModelProto.Annotation annotation = 9;
- Specified by:
getAnnotationOrBuilderList
in interfaceMPModelProtoOrBuilder
-
getAnnotationCount
public int getAnnotationCount()repeated .operations_research.MPModelProto.Annotation annotation = 9;
- Specified by:
getAnnotationCount
in interfaceMPModelProtoOrBuilder
-
getAnnotation
repeated .operations_research.MPModelProto.Annotation annotation = 9;
- Specified by:
getAnnotation
in interfaceMPModelProtoOrBuilder
-
getAnnotationOrBuilder
repeated .operations_research.MPModelProto.Annotation annotation = 9;
- Specified by:
getAnnotationOrBuilder
in interfaceMPModelProtoOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessage
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in classcom.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
- Throws:
IOException
-
parseFrom
public static MPModelProto parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static MPModelProto parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static MPModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected MPModelProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForType
in classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-