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, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public 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.Builder
clear
in interface com.google.protobuf.MessageLite.Builder
clear
in class com.google.protobuf.GeneratedMessage.Builder<IntegerVariableProto.Builder>
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface com.google.protobuf.Message.Builder
getDescriptorForType
in interface com.google.protobuf.MessageOrBuilder
getDescriptorForType
in class com.google.protobuf.GeneratedMessage.Builder<IntegerVariableProto.Builder>
public IntegerVariableProto getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public IntegerVariableProto build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public IntegerVariableProto buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public IntegerVariableProto.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
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.MessageLiteOrBuilder
isInitialized
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.Builder
mergeFrom
in interface com.google.protobuf.MessageLite.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<IntegerVariableProto.Builder>
java.io.IOException
public java.lang.String getName()
For debug/logging only. Can be empty.
string name = 1;
getName
in interface IntegerVariableProtoOrBuilder
public com.google.protobuf.ByteString getNameBytes()
For debug/logging only. Can be empty.
string name = 1;
getNameBytes
in interface IntegerVariableProtoOrBuilder
public 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 IntegerVariableProtoOrBuilder
public 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 IntegerVariableProtoOrBuilder
public 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 IntegerVariableProtoOrBuilder
index
- 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 © 2025. All rights reserved.