public static final class MPSosConstraint.Builder extends com.google.protobuf.GeneratedMessage.Builder<MPSosConstraint.Builder> implements MPSosConstraintOrBuilder
Special Ordered Set (SOS) constraints of type 1 or 2. See https://en.wikipedia.org/wiki/Special_ordered_set As of 2019/04, only SCIP and Gurobi support this constraint type.Protobuf type
operations_research.MPSosConstraint| Modifier and Type | Method and Description |
|---|---|
MPSosConstraint.Builder |
addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer> values)
Variable index (w.r.t.
|
MPSosConstraint.Builder |
addAllWeight(java.lang.Iterable<? extends java.lang.Double> values)
Optional: SOS weights.
|
MPSosConstraint.Builder |
addVarIndex(int value)
Variable index (w.r.t.
|
MPSosConstraint.Builder |
addWeight(double value)
Optional: SOS weights.
|
MPSosConstraint |
build() |
MPSosConstraint |
buildPartial() |
MPSosConstraint.Builder |
clear() |
MPSosConstraint.Builder |
clearType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; |
MPSosConstraint.Builder |
clearVarIndex()
Variable index (w.r.t.
|
MPSosConstraint.Builder |
clearWeight()
Optional: SOS weights.
|
MPSosConstraint |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
MPSosConstraint.Type |
getType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; |
int |
getVarIndex(int index)
Variable index (w.r.t.
|
int |
getVarIndexCount()
Variable index (w.r.t.
|
java.util.List<java.lang.Integer> |
getVarIndexList()
Variable index (w.r.t.
|
double |
getWeight(int index)
Optional: SOS weights.
|
int |
getWeightCount()
Optional: SOS weights.
|
java.util.List<java.lang.Double> |
getWeightList()
Optional: SOS weights.
|
boolean |
hasType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
MPSosConstraint.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
MPSosConstraint.Builder |
mergeFrom(com.google.protobuf.Message other) |
MPSosConstraint.Builder |
mergeFrom(MPSosConstraint other) |
MPSosConstraint.Builder |
setType(MPSosConstraint.Type value)
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT]; |
MPSosConstraint.Builder |
setVarIndex(int index,
int value)
Variable index (w.r.t.
|
MPSosConstraint.Builder |
setWeight(int index,
double value)
Optional: SOS weights.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<MPSosConstraint.Builder>public MPSosConstraint.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<MPSosConstraint.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<MPSosConstraint.Builder>public MPSosConstraint getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic MPSosConstraint build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic MPSosConstraint buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic MPSosConstraint.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<MPSosConstraint.Builder>public MPSosConstraint.Builder mergeFrom(MPSosConstraint other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<MPSosConstraint.Builder>public MPSosConstraint.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<MPSosConstraint.Builder>java.io.IOExceptionpublic boolean hasType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];hasType in interface MPSosConstraintOrBuilderpublic MPSosConstraint.Type getType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];getType in interface MPSosConstraintOrBuilderpublic MPSosConstraint.Builder setType(MPSosConstraint.Type value)
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];value - The type to set.public MPSosConstraint.Builder clearType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];public java.util.List<java.lang.Integer> getVarIndexList()
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;getVarIndexList in interface MPSosConstraintOrBuilderpublic int getVarIndexCount()
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;getVarIndexCount in interface MPSosConstraintOrBuilderpublic int getVarIndex(int index)
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;getVarIndex in interface MPSosConstraintOrBuilderindex - The index of the element to return.public MPSosConstraint.Builder setVarIndex(int index, int value)
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;index - The index to set the value at.value - The varIndex to set.public MPSosConstraint.Builder addVarIndex(int value)
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;value - The varIndex to add.public MPSosConstraint.Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer> values)
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;values - The varIndex to add.public MPSosConstraint.Builder clearVarIndex()
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;public java.util.List<java.lang.Double> getWeightList()
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;getWeightList in interface MPSosConstraintOrBuilderpublic int getWeightCount()
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;getWeightCount in interface MPSosConstraintOrBuilderpublic double getWeight(int index)
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;getWeight in interface MPSosConstraintOrBuilderindex - The index of the element to return.public MPSosConstraint.Builder setWeight(int index, double value)
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;index - The index to set the value at.value - The weight to set.public MPSosConstraint.Builder addWeight(double value)
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;value - The weight to add.public MPSosConstraint.Builder addAllWeight(java.lang.Iterable<? extends java.lang.Double> values)
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;values - The weight to add.public MPSosConstraint.Builder clearWeight()
Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
repeated double weight = 3;Copyright © 2024. All rights reserved.