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 classAnnotations can be freely added by users who want to attach arbitrary payload to the model's variables or constraints.static interfacestatic final classMPModelProto 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.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAnnotation(int index) repeated .operations_research.MPModelProto.Annotation annotation = 9;intrepeated .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.intAll 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 MPModelProtostatic final com.google.protobuf.Descriptors.DescriptorgetGeneralConstraint(int index) All the general constraints appearing in the model.intAll 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.booleanTrue if the problem is a maximization problem.getName()Name of the model.com.google.protobuf.ByteStringName of the model.doubleOffset for the objective function.com.google.protobuf.Parser<MPModelProto> Optionally, a quadratic objective.Optionally, a quadratic objective.intSolution hint.Solution hint.getVariable(int index) All the variables appearing in the model.intAll 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.inthashCode()booleanTrue if the problem is a maximization problem.booleanhasName()Name of the model.booleanOffset for the objective function.booleanOptionally, a quadratic objective.booleanSolution hint.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanstatic MPModelProto.Builderstatic MPModelProto.BuildernewBuilder(MPModelProto prototype) protected MPModelProto.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static MPModelProtoparseDelimitedFrom(InputStream input) static MPModelProtoparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProtoparseFrom(byte[] data) static MPModelProtoparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProtoparseFrom(com.google.protobuf.ByteString data) static MPModelProtoparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProtoparseFrom(com.google.protobuf.CodedInputStream input) static MPModelProtoparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProtoparseFrom(InputStream input) static MPModelProtoparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static MPModelProtoparseFrom(ByteBuffer data) static MPModelProtoparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<MPModelProto> parser()voidwriteTo(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, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods 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:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getVariableList
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;- Specified by:
getVariableListin interfaceMPModelProtoOrBuilder
-
getVariableOrBuilderList
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;- Specified by:
getVariableOrBuilderListin interfaceMPModelProtoOrBuilder
-
getVariableCount
public int getVariableCount()All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;- Specified by:
getVariableCountin interfaceMPModelProtoOrBuilder
-
getVariable
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;- Specified by:
getVariablein interfaceMPModelProtoOrBuilder
-
getVariableOrBuilder
All the variables appearing in the model.
repeated .operations_research.MPVariableProto variable = 3;- Specified by:
getVariableOrBuilderin interfaceMPModelProtoOrBuilder
-
getConstraintList
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;- Specified by:
getConstraintListin interfaceMPModelProtoOrBuilder
-
getConstraintOrBuilderList
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;- Specified by:
getConstraintOrBuilderListin interfaceMPModelProtoOrBuilder
-
getConstraintCount
public int getConstraintCount()All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;- Specified by:
getConstraintCountin interfaceMPModelProtoOrBuilder
-
getConstraint
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;- Specified by:
getConstraintin interfaceMPModelProtoOrBuilder
-
getConstraintOrBuilder
All the constraints appearing in the model.
repeated .operations_research.MPConstraintProto constraint = 4;- Specified by:
getConstraintOrBuilderin 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:
getGeneralConstraintListin 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:
getGeneralConstraintOrBuilderListin 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:
getGeneralConstraintCountin 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:
getGeneralConstraintin 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:
getGeneralConstraintOrBuilderin interfaceMPModelProtoOrBuilder
-
hasMaximize
public boolean hasMaximize()True if the problem is a maximization problem. Minimize by default.
optional bool maximize = 1 [default = false];- Specified by:
hasMaximizein 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:
getMaximizein 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:
hasObjectiveOffsetin 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:
getObjectiveOffsetin 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:
hasQuadraticObjectivein 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:
getQuadraticObjectivein 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:
getQuadraticObjectiveOrBuilderin interfaceMPModelProtoOrBuilder
-
hasName
public boolean hasName()Name of the model.
optional string name = 5 [default = ""];- Specified by:
hasNamein interfaceMPModelProtoOrBuilder- Returns:
- Whether the name field is set.
-
getName
Name of the model.
optional string name = 5 [default = ""];- Specified by:
getNamein interfaceMPModelProtoOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()Name of the model.
optional string name = 5 [default = ""];- Specified by:
getNameBytesin 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:
hasSolutionHintin 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:
getSolutionHintin 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:
getSolutionHintOrBuilderin interfaceMPModelProtoOrBuilder
-
getAnnotationList
repeated .operations_research.MPModelProto.Annotation annotation = 9;- Specified by:
getAnnotationListin interfaceMPModelProtoOrBuilder
-
getAnnotationOrBuilderList
repeated .operations_research.MPModelProto.Annotation annotation = 9;- Specified by:
getAnnotationOrBuilderListin interfaceMPModelProtoOrBuilder
-
getAnnotationCount
public int getAnnotationCount()repeated .operations_research.MPModelProto.Annotation annotation = 9;- Specified by:
getAnnotationCountin interfaceMPModelProtoOrBuilder
-
getAnnotation
repeated .operations_research.MPModelProto.Annotation annotation = 9;- Specified by:
getAnnotationin interfaceMPModelProtoOrBuilder
-
getAnnotationOrBuilder
repeated .operations_research.MPModelProto.Annotation annotation = 9;- Specified by:
getAnnotationOrBuilderin interfaceMPModelProtoOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein 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:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected MPModelProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-