![]() |
Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
|
Static Public Member Functions | |
static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
Protected Member Functions | |
com.google.protobuf.GeneratedMessage.FieldAccessorTable | internalGetFieldAccessorTable () |
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
Definition at line 513 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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. |
Definition at line 857 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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. |
Definition at line 1030 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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. |
Definition at line 839 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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. |
Definition at line 1004 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder.build | ( | ) |
Definition at line 562 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder.buildPartial | ( | ) |
Definition at line 571 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.clear | ( | ) |
Definition at line 541 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.clearType | ( | ) |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
Definition at line 756 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.clearVarIndex | ( | ) |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
Definition at line 875 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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;
Definition at line 1056 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder.getDefaultInstanceForType | ( | ) |
Definition at line 557 of file MPSosConstraint.java.
|
static |
Definition at line 518 of file MPSosConstraint.java.
com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPSosConstraint.Builder.getDescriptorForType | ( | ) |
Definition at line 552 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint.Type com.google.ortools.linearsolver.MPSosConstraint.Builder.getType | ( | ) |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 734 of file MPSosConstraint.java.
int com.google.ortools.linearsolver.MPSosConstraint.Builder.getVarIndex | ( | int | index | ) |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
index | The index of the element to return. |
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 806 of file MPSosConstraint.java.
int com.google.ortools.linearsolver.MPSosConstraint.Builder.getVarIndexCount | ( | ) |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 793 of file MPSosConstraint.java.
java.util.List< java.lang.Integer > com.google.ortools.linearsolver.MPSosConstraint.Builder.getVarIndexList | ( | ) |
Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
repeated int32 var_index = 2;
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 780 of file MPSosConstraint.java.
double com.google.ortools.linearsolver.MPSosConstraint.Builder.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;
index | The index of the element to return. |
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 955 of file MPSosConstraint.java.
int com.google.ortools.linearsolver.MPSosConstraint.Builder.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;
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 934 of file MPSosConstraint.java.
java.util.List< java.lang.Double > com.google.ortools.linearsolver.MPSosConstraint.Builder.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;
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 913 of file MPSosConstraint.java.
boolean com.google.ortools.linearsolver.MPSosConstraint.Builder.hasType | ( | ) |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
Implements com.google.ortools.linearsolver.MPSosConstraintOrBuilder.
Definition at line 726 of file MPSosConstraint.java.
|
protected |
Definition at line 524 of file MPSosConstraint.java.
final boolean com.google.ortools.linearsolver.MPSosConstraint.Builder.isInitialized | ( | ) |
Definition at line 639 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.mergeFrom | ( | com.google.ortools.linearsolver.MPSosConstraint | other | ) |
Definition at line 606 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.mergeFrom | ( | com.google.protobuf.CodedInputStream | input, |
com.google.protobuf.ExtensionRegistryLite | extensionRegistry ) throws java.io.IOException |
Definition at line 644 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.mergeFrom | ( | com.google.protobuf.Message | other | ) |
Definition at line 597 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.setType | ( | com.google.ortools.linearsolver.MPSosConstraint.Type | value | ) |
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
value | The type to set. |
Definition at line 743 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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. |
Definition at line 820 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.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. |
Definition at line 977 of file MPSosConstraint.java.