Google OR-Tools v9.12
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 ()
 

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 421 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 845 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 752 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 832 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 730 of file LinearObjective.java.

◆ build()

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

Definition at line 471 of file LinearObjective.java.

◆ buildPartial()

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

Definition at line 480 of file LinearObjective.java.

◆ clear()

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

Definition at line 449 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 858 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 774 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 938 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 978 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 809 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 801 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 793 of file LinearObjective.java.

◆ getDefaultInstanceForType()

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

Definition at line 466 of file LinearObjective.java.

◆ getDescriptor()

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

Definition at line 426 of file LinearObjective.java.

◆ getDescriptorForType()

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

Definition at line 461 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 689 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 672 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 655 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 899 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 959 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 881 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 951 of file LinearObjective.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 432 of file LinearObjective.java.

◆ isInitialized()

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

Definition at line 555 of file LinearObjective.java.

◆ mergeFrom() [1/3]

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

Definition at line 519 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 560 of file LinearObjective.java.

◆ mergeFrom() [3/3]

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

Definition at line 510 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 818 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 707 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 917 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 967 of file LinearObjective.java.


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