public static final class IntegerVariableProto.Builder extends com.google.protobuf.GeneratedMessage.Builder<IntegerVariableProto.Builder> implements IntegerVariableProtoOrBuilder
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| Modifier and Type | Method and Description |
|---|---|
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}].
|
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}].
|
IntegerVariableProto |
build() |
IntegerVariableProto |
buildPartial() |
IntegerVariableProto.Builder |
clear() |
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}].
|
IntegerVariableProto.Builder |
clearName()
For debug/logging only.
|
IntegerVariableProto |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
long |
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}].
|
int |
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}].
|
java.util.List<java.lang.Long> |
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}].
|
java.lang.String |
getName()
For debug/logging only.
|
com.google.protobuf.ByteString |
getNameBytes()
For debug/logging only.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
IntegerVariableProto.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
IntegerVariableProto.Builder |
mergeFrom(IntegerVariableProto other) |
IntegerVariableProto.Builder |
mergeFrom(com.google.protobuf.Message other) |
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}].
|
IntegerVariableProto.Builder |
setName(java.lang.String value)
For debug/logging only.
|
IntegerVariableProto.Builder |
setNameBytes(com.google.protobuf.ByteString value)
For debug/logging only.
|
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<IntegerVariableProto.Builder>public IntegerVariableProto.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<IntegerVariableProto.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<IntegerVariableProto.Builder>public IntegerVariableProto getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic IntegerVariableProto build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic IntegerVariableProto buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic IntegerVariableProto.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<IntegerVariableProto.Builder>public IntegerVariableProto.Builder mergeFrom(IntegerVariableProto other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<IntegerVariableProto.Builder>public IntegerVariableProto.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<IntegerVariableProto.Builder>java.io.IOExceptionpublic java.lang.String getName()
For debug/logging only. Can be empty.
string name = 1;getName in interface IntegerVariableProtoOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
For debug/logging only. Can be empty.
string name = 1;getNameBytes in interface IntegerVariableProtoOrBuilderpublic IntegerVariableProto.Builder setName(java.lang.String value)
For debug/logging only. Can be empty.
string name = 1;value - The name to set.public IntegerVariableProto.Builder clearName()
For debug/logging only. Can be empty.
string name = 1;public 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.public java.util.List<java.lang.Long> 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;getDomainList in interface IntegerVariableProtoOrBuilderpublic int 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;getDomainCount in interface IntegerVariableProtoOrBuilderpublic long 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;getDomain in interface IntegerVariableProtoOrBuilderindex - The index of the element to return.public 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.public 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.public 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.public 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;Copyright © 2024. All rights reserved.