![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
An integer variable. It will be referred to by an int32 corresponding to its index in a CpModelProto variables field. Depending on the context, a reference to a variable whose domain is in [0, 1] can also be seen as a Boolean that will be true if the variable value is 1 and false if it is 0. When used in this context, the field name will always contain the word "literal". Negative reference (advanced usage): to simplify the creation of a model and for efficiency reasons, all the "literal" or "variable" fields can also contain a negative index. A negative index i will refer to the negation of the integer variable at index -i -1 or to NOT the literal at the same index. Ex: A variable index 4 will refer to the integer variable model.variables(4) and an index of -5 will refer to the negation of the same variable. A literal index 4 will refer to the logical fact that model.variable(4) == 1 and a literal index of -5 will refer to the logical fact model.variable(4) == 0.
Protobuf type operations_research.sat.IntegerVariableProto
Definition at line 416 of file IntegerVariableProto.java.
Public Member Functions | |
| Builder | clear () |
| com.google.protobuf.Descriptors.Descriptor | getDescriptorForType () |
| com.google.ortools.sat.IntegerVariableProto | getDefaultInstanceForType () |
| com.google.ortools.sat.IntegerVariableProto | build () |
| com.google.ortools.sat.IntegerVariableProto | buildPartial () |
| Builder | mergeFrom (com.google.protobuf.Message other) |
| Builder | mergeFrom (com.google.ortools.sat.IntegerVariableProto other) |
| final boolean | isInitialized () |
| Builder | mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException |
| java.lang.String | getName () |
| com.google.protobuf.ByteString | getNameBytes () |
| Builder | setName (java.lang.String value) |
| Builder | clearName () |
| Builder | setNameBytes (com.google.protobuf.ByteString value) |
| java.util.List< java.lang.Long > | getDomainList () |
| int | getDomainCount () |
| long | getDomain (int index) |
| Builder | setDomain (int index, long value) |
| Builder | addDomain (long value) |
| Builder | addAllDomain (java.lang.Iterable<? extends java.lang.Long > values) |
| Builder | clearDomain () |
Static Public Member Functions | |
| static final com.google.protobuf.Descriptors.Descriptor | getDescriptor () |
Protected Member Functions | |
| com.google.protobuf.GeneratedMessage.FieldAccessorTable | internalGetFieldAccessorTable () |
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.addAllDomain | ( | java.lang.Iterable<? extends java.lang.Long > | values | ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
| values | The domain to add. |
Definition at line 859 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.addDomain | ( | long | value | ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
| value | The domain to add. |
Definition at line 826 of file IntegerVariableProto.java.
| com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.IntegerVariableProto.Builder.build | ( | ) |
Definition at line 464 of file IntegerVariableProto.java.
| com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.IntegerVariableProto.Builder.buildPartial | ( | ) |
Definition at line 473 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.clear | ( | ) |
Definition at line 444 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.clearDomain | ( | ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
Definition at line 892 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.clearName | ( | ) |
For debug/logging only. Can be empty.
string name = 1;
Definition at line 650 of file IntegerVariableProto.java.
| com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.IntegerVariableProto.Builder.getDefaultInstanceForType | ( | ) |
Definition at line 459 of file IntegerVariableProto.java.
|
static |
Definition at line 421 of file IntegerVariableProto.java.
| com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.IntegerVariableProto.Builder.getDescriptorForType | ( | ) |
Definition at line 454 of file IntegerVariableProto.java.
| long com.google.ortools.sat.IntegerVariableProto.Builder.getDomain | ( | int | index | ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
| index | The index of the element to return. |
Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.
Definition at line 763 of file IntegerVariableProto.java.
| int com.google.ortools.sat.IntegerVariableProto.Builder.getDomainCount | ( | ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.
Definition at line 735 of file IntegerVariableProto.java.
| java.util.List< java.lang.Long > com.google.ortools.sat.IntegerVariableProto.Builder.getDomainList | ( | ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.
Definition at line 707 of file IntegerVariableProto.java.
| java.lang.String com.google.ortools.sat.IntegerVariableProto.Builder.getName | ( | ) |
For debug/logging only. Can be empty.
string name = 1;
Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.
Definition at line 592 of file IntegerVariableProto.java.
| com.google.protobuf.ByteString com.google.ortools.sat.IntegerVariableProto.Builder.getNameBytes | ( | ) |
For debug/logging only. Can be empty.
string name = 1;
Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.
Definition at line 613 of file IntegerVariableProto.java.
|
protected |
Definition at line 427 of file IntegerVariableProto.java.
| final boolean com.google.ortools.sat.IntegerVariableProto.Builder.isInitialized | ( | ) |
Definition at line 525 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.mergeFrom | ( | com.google.ortools.sat.IntegerVariableProto | other | ) |
Definition at line 501 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.mergeFrom | ( | com.google.protobuf.CodedInputStream | input, |
| com.google.protobuf.ExtensionRegistryLite | extensionRegistry ) throws java.io.IOException |
Definition at line 530 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.mergeFrom | ( | com.google.protobuf.Message | other | ) |
Definition at line 492 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.setDomain | ( | int | index, |
| long | value ) |
The variable domain given as a sorted list of n disjoint intervals
[min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
The most common example being just [min, max].
If min == max, then this is a constant variable.
We have:
- domain_size() is always even.
- min == domain.front();
- max == domain.back();
- for all i < n : min_i <= max_i
- for all i < n-1 : max_i + 1 < min_{i+1}.
Note that we check at validation that a variable domain is small enough so
that we don't run into integer overflow in our algorithms. Because of that,
you cannot just have "unbounded" variable like [0, kint64max] and should
try to specify tighter domains.
repeated int64 domain = 2;
| index | The index to set the value at. |
| value | The domain to set. |
Definition at line 792 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.setName | ( | java.lang.String | value | ) |
For debug/logging only. Can be empty.
string name = 1;
| value | The name to set. |
Definition at line 634 of file IntegerVariableProto.java.
| Builder com.google.ortools.sat.IntegerVariableProto.Builder.setNameBytes | ( | com.google.protobuf.ByteString | value | ) |
For debug/logging only. Can be empty.
string name = 1;
| value | The bytes for name to set. |
Definition at line 665 of file IntegerVariableProto.java.