Google OR-Tools v9.11
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 512 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 856 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 1029 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 838 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 1003 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder.build | ( | ) |
Definition at line 561 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder.buildPartial | ( | ) |
Definition at line 570 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.clear | ( | ) |
Definition at line 540 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 755 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 874 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 1055 of file MPSosConstraint.java.
com.google.ortools.linearsolver.MPSosConstraint com.google.ortools.linearsolver.MPSosConstraint.Builder.getDefaultInstanceForType | ( | ) |
Definition at line 556 of file MPSosConstraint.java.
|
static |
Definition at line 517 of file MPSosConstraint.java.
com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPSosConstraint.Builder.getDescriptorForType | ( | ) |
Definition at line 551 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 733 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 805 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 792 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 779 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 954 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 933 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 912 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 725 of file MPSosConstraint.java.
|
protected |
Definition at line 523 of file MPSosConstraint.java.
final boolean com.google.ortools.linearsolver.MPSosConstraint.Builder.isInitialized | ( | ) |
Definition at line 638 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.mergeFrom | ( | com.google.ortools.linearsolver.MPSosConstraint | other | ) |
Definition at line 605 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 643 of file MPSosConstraint.java.
Builder com.google.ortools.linearsolver.MPSosConstraint.Builder.mergeFrom | ( | com.google.protobuf.Message | other | ) |
Definition at line 596 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 742 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 819 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 976 of file MPSosConstraint.java.