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

Public Member Functions

Builder clear ()
 
com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
 
com.google.ortools.sat.LinearObjective getDefaultInstanceForType ()
 
com.google.ortools.sat.LinearObjective build ()
 
com.google.ortools.sat.LinearObjective buildPartial ()
 
Builder mergeFrom (com.google.protobuf.Message other)
 
Builder mergeFrom (com.google.ortools.sat.LinearObjective other)
 
final boolean isInitialized ()
 
Builder mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
 
java.util.List< java.lang.Integer > getLiteralsList ()
 
int getLiteralsCount ()
 
int getLiterals (int index)
 
Builder setLiterals (int index, int value)
 
Builder addLiterals (int value)
 
Builder addAllLiterals (java.lang.Iterable<? extends java.lang.Integer > values)
 
Builder clearLiterals ()
 
java.util.List< java.lang.Long > getCoefficientsList ()
 
int getCoefficientsCount ()
 
long getCoefficients (int index)
 
Builder setCoefficients (int index, long value)
 
Builder addCoefficients (long value)
 
Builder addAllCoefficients (java.lang.Iterable<? extends java.lang.Long > values)
 
Builder clearCoefficients ()
 
boolean hasOffset ()
 
double getOffset ()
 
Builder setOffset (double value)
 
Builder clearOffset ()
 
boolean hasScalingFactor ()
 
double getScalingFactor ()
 
Builder setScalingFactor (double value)
 
Builder clearScalingFactor ()
 
- Public Member Functions inherited from com.google.ortools.sat.LinearObjectiveOrBuilder

Static Public Member Functions

static final com.google.protobuf.Descriptors.Descriptor getDescriptor ()
 

Protected Member Functions

com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable ()
 

Detailed Description

The objective of an optimization problem.

Protobuf type operations_research.sat.LinearObjective

Definition at line 420 of file LinearObjective.java.

Member Function Documentation

◆ addAllCoefficients()

Builder com.google.ortools.sat.LinearObjective.Builder.addAllCoefficients ( java.lang.Iterable<? extends java.lang.Long > values)

repeated int64 coefficients = 2;

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

Definition at line 844 of file LinearObjective.java.

◆ addAllLiterals()

Builder com.google.ortools.sat.LinearObjective.Builder.addAllLiterals ( java.lang.Iterable<? extends java.lang.Integer > values)
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

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

Definition at line 751 of file LinearObjective.java.

◆ addCoefficients()

Builder com.google.ortools.sat.LinearObjective.Builder.addCoefficients ( long value)

repeated int64 coefficients = 2;

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

Definition at line 831 of file LinearObjective.java.

◆ addLiterals()

Builder com.google.ortools.sat.LinearObjective.Builder.addLiterals ( int value)
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

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

Definition at line 729 of file LinearObjective.java.

◆ build()

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

Definition at line 470 of file LinearObjective.java.

◆ buildPartial()

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

Definition at line 479 of file LinearObjective.java.

◆ clear()

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

Definition at line 448 of file LinearObjective.java.

◆ clearCoefficients()

Builder com.google.ortools.sat.LinearObjective.Builder.clearCoefficients ( )

repeated int64 coefficients = 2;

Returns
This builder for chaining.

Definition at line 857 of file LinearObjective.java.

◆ clearLiterals()

Builder com.google.ortools.sat.LinearObjective.Builder.clearLiterals ( )
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
This builder for chaining.

Definition at line 773 of file LinearObjective.java.

◆ clearOffset()

Builder com.google.ortools.sat.LinearObjective.Builder.clearOffset ( )
For a given variable assignment, the "real" problem objective value is
'scaling_factor * (minimization_objective + offset)' where
'minimization_objective is the one defined just above.

Note that this is not what we minimize, but it is what we display.
In particular if scaling_factor is negative, then the "real" problem is
a maximization problem, even if the "internal" objective is minimized.

optional double offset = 3 [default = 0];

Returns
This builder for chaining.

Definition at line 937 of file LinearObjective.java.

◆ clearScalingFactor()

Builder com.google.ortools.sat.LinearObjective.Builder.clearScalingFactor ( )

optional double scaling_factor = 4 [default = 1];

Returns
This builder for chaining.

Definition at line 977 of file LinearObjective.java.

◆ getCoefficients()

long com.google.ortools.sat.LinearObjective.Builder.getCoefficients ( int index)

repeated int64 coefficients = 2;

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

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 808 of file LinearObjective.java.

◆ getCoefficientsCount()

int com.google.ortools.sat.LinearObjective.Builder.getCoefficientsCount ( )

repeated int64 coefficients = 2;

Returns
The count of coefficients.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 800 of file LinearObjective.java.

◆ getCoefficientsList()

java.util.List< java.lang.Long > com.google.ortools.sat.LinearObjective.Builder.getCoefficientsList ( )

repeated int64 coefficients = 2;

Returns
A list containing the coefficients.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 792 of file LinearObjective.java.

◆ getDefaultInstanceForType()

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

Definition at line 465 of file LinearObjective.java.

◆ getDescriptor()

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

Definition at line 425 of file LinearObjective.java.

◆ getDescriptorForType()

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

Definition at line 460 of file LinearObjective.java.

◆ getLiterals()

int com.google.ortools.sat.LinearObjective.Builder.getLiterals ( int index)
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

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

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 688 of file LinearObjective.java.

◆ getLiteralsCount()

int com.google.ortools.sat.LinearObjective.Builder.getLiteralsCount ( )
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
The count of literals.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 671 of file LinearObjective.java.

◆ getLiteralsList()

java.util.List< java.lang.Integer > com.google.ortools.sat.LinearObjective.Builder.getLiteralsList ( )
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

Returns
A list containing the literals.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 654 of file LinearObjective.java.

◆ getOffset()

double com.google.ortools.sat.LinearObjective.Builder.getOffset ( )
For a given variable assignment, the "real" problem objective value is
'scaling_factor * (minimization_objective + offset)' where
'minimization_objective is the one defined just above.

Note that this is not what we minimize, but it is what we display.
In particular if scaling_factor is negative, then the "real" problem is
a maximization problem, even if the "internal" objective is minimized.

optional double offset = 3 [default = 0];

Returns
The offset.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 898 of file LinearObjective.java.

◆ getScalingFactor()

double com.google.ortools.sat.LinearObjective.Builder.getScalingFactor ( )

optional double scaling_factor = 4 [default = 1];

Returns
The scalingFactor.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 958 of file LinearObjective.java.

◆ hasOffset()

boolean com.google.ortools.sat.LinearObjective.Builder.hasOffset ( )
For a given variable assignment, the "real" problem objective value is
'scaling_factor * (minimization_objective + offset)' where
'minimization_objective is the one defined just above.

Note that this is not what we minimize, but it is what we display.
In particular if scaling_factor is negative, then the "real" problem is
a maximization problem, even if the "internal" objective is minimized.

optional double offset = 3 [default = 0];

Returns
Whether the offset field is set.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 880 of file LinearObjective.java.

◆ hasScalingFactor()

boolean com.google.ortools.sat.LinearObjective.Builder.hasScalingFactor ( )

optional double scaling_factor = 4 [default = 1];

Returns
Whether the scalingFactor field is set.

Implements com.google.ortools.sat.LinearObjectiveOrBuilder.

Definition at line 950 of file LinearObjective.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 431 of file LinearObjective.java.

◆ isInitialized()

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

Definition at line 554 of file LinearObjective.java.

◆ mergeFrom() [1/3]

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

Definition at line 518 of file LinearObjective.java.

◆ mergeFrom() [2/3]

Builder com.google.ortools.sat.LinearObjective.Builder.mergeFrom ( com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry ) throws java.io.IOException

Definition at line 559 of file LinearObjective.java.

◆ mergeFrom() [3/3]

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

Definition at line 509 of file LinearObjective.java.

◆ setCoefficients()

Builder com.google.ortools.sat.LinearObjective.Builder.setCoefficients ( int index,
long value )

repeated int64 coefficients = 2;

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

Definition at line 817 of file LinearObjective.java.

◆ setLiterals()

Builder com.google.ortools.sat.LinearObjective.Builder.setLiterals ( int index,
int value )
The goal is always to minimize the linear Boolean formula defined by these
two fields: sum_i literal_i * coefficient_i where literal_i is 1 iff
literal_i is true in a given assignment.

Note that the same variable shouldn't appear twice and that zero
coefficients are not allowed.

repeated int32 literals = 1;

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

Definition at line 706 of file LinearObjective.java.

◆ setOffset()

Builder com.google.ortools.sat.LinearObjective.Builder.setOffset ( double value)
For a given variable assignment, the "real" problem objective value is
'scaling_factor * (minimization_objective + offset)' where
'minimization_objective is the one defined just above.

Note that this is not what we minimize, but it is what we display.
In particular if scaling_factor is negative, then the "real" problem is
a maximization problem, even if the "internal" objective is minimized.

optional double offset = 3 [default = 0];

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

Definition at line 916 of file LinearObjective.java.

◆ setScalingFactor()

Builder com.google.ortools.sat.LinearObjective.Builder.setScalingFactor ( double value)

optional double scaling_factor = 4 [default = 1];

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

Definition at line 966 of file LinearObjective.java.


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