Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.sat.IntegerVariableProto.Builder Class Reference
Inheritance diagram for com.google.ortools.sat.IntegerVariableProto.Builder:
com.google.ortools.sat.IntegerVariableProtoOrBuilder

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 ()
 

Detailed Description

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 415 of file IntegerVariableProto.java.

Member Function Documentation

◆ addAllDomain()

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;

Parameters
valuesThe domain to add.
Returns
This builder for chaining.

Definition at line 858 of file IntegerVariableProto.java.

◆ addDomain()

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;

Parameters
valueThe domain to add.
Returns
This builder for chaining.

Definition at line 825 of file IntegerVariableProto.java.

◆ build()

com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.IntegerVariableProto.Builder.build ( )

Definition at line 463 of file IntegerVariableProto.java.

◆ buildPartial()

com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.IntegerVariableProto.Builder.buildPartial ( )

Definition at line 472 of file IntegerVariableProto.java.

◆ clear()

Builder com.google.ortools.sat.IntegerVariableProto.Builder.clear ( )

Definition at line 443 of file IntegerVariableProto.java.

◆ clearDomain()

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;

Returns
This builder for chaining.

Definition at line 891 of file IntegerVariableProto.java.

◆ clearName()

Builder com.google.ortools.sat.IntegerVariableProto.Builder.clearName ( )
For debug/logging only. Can be empty.

string name = 1;

Returns
This builder for chaining.

Definition at line 649 of file IntegerVariableProto.java.

◆ getDefaultInstanceForType()

com.google.ortools.sat.IntegerVariableProto com.google.ortools.sat.IntegerVariableProto.Builder.getDefaultInstanceForType ( )

Definition at line 458 of file IntegerVariableProto.java.

◆ getDescriptor()

static final com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.IntegerVariableProto.Builder.getDescriptor ( )
static

Definition at line 420 of file IntegerVariableProto.java.

◆ getDescriptorForType()

com.google.protobuf.Descriptors.Descriptor com.google.ortools.sat.IntegerVariableProto.Builder.getDescriptorForType ( )

Definition at line 453 of file IntegerVariableProto.java.

◆ getDomain()

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;

Parameters
indexThe index of the element to return.
Returns
The domain at the given index.

Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.

Definition at line 762 of file IntegerVariableProto.java.

◆ getDomainCount()

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;

Returns
The count of domain.

Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.

Definition at line 734 of file IntegerVariableProto.java.

◆ getDomainList()

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;

Returns
A list containing the domain.

Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.

Definition at line 706 of file IntegerVariableProto.java.

◆ getName()

java.lang.String com.google.ortools.sat.IntegerVariableProto.Builder.getName ( )
For debug/logging only. Can be empty.

string name = 1;

Returns
The name.

Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.

Definition at line 591 of file IntegerVariableProto.java.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.sat.IntegerVariableProto.Builder.getNameBytes ( )
For debug/logging only. Can be empty.

string name = 1;

Returns
The bytes for name.

Implements com.google.ortools.sat.IntegerVariableProtoOrBuilder.

Definition at line 612 of file IntegerVariableProto.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.ortools.sat.IntegerVariableProto.Builder.internalGetFieldAccessorTable ( )
protected

Definition at line 426 of file IntegerVariableProto.java.

◆ isInitialized()

final boolean com.google.ortools.sat.IntegerVariableProto.Builder.isInitialized ( )

Definition at line 524 of file IntegerVariableProto.java.

◆ mergeFrom() [1/3]

Builder com.google.ortools.sat.IntegerVariableProto.Builder.mergeFrom ( com.google.ortools.sat.IntegerVariableProto other)

Definition at line 500 of file IntegerVariableProto.java.

◆ mergeFrom() [2/3]

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 529 of file IntegerVariableProto.java.

◆ mergeFrom() [3/3]

Builder com.google.ortools.sat.IntegerVariableProto.Builder.mergeFrom ( com.google.protobuf.Message other)

Definition at line 491 of file IntegerVariableProto.java.

◆ setDomain()

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;

Parameters
indexThe index to set the value at.
valueThe domain to set.
Returns
This builder for chaining.

Definition at line 791 of file IntegerVariableProto.java.

◆ setName()

Builder com.google.ortools.sat.IntegerVariableProto.Builder.setName ( java.lang.String value)
For debug/logging only. Can be empty.

string name = 1;

Parameters
valueThe name to set.
Returns
This builder for chaining.

Definition at line 633 of file IntegerVariableProto.java.

◆ setNameBytes()

Builder com.google.ortools.sat.IntegerVariableProto.Builder.setNameBytes ( com.google.protobuf.ByteString value)
For debug/logging only. Can be empty.

string name = 1;

Parameters
valueThe bytes for name to set.
Returns
This builder for chaining.

Definition at line 664 of file IntegerVariableProto.java.


The documentation for this class was generated from the following file: