Google OR-Tools v9.9
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 clone ()
 
Builder setField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
Builder clearField (com.google.protobuf.Descriptors.FieldDescriptor field)
 
Builder clearOneof (com.google.protobuf.Descriptors.OneofDescriptor oneof)
 
Builder setRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
 
Builder addRepeatedField (com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
 
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 ()
 
final Builder setUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 
final Builder mergeUnknownFields (final com.google.protobuf.UnknownFieldSet unknownFields)
 

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

The objective of an optimization problem.

Protobuf type operations_research.sat.LinearObjective

Definition at line 418 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 874 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 781 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 861 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 759 of file LinearObjective.java.

◆ addRepeatedField()

Builder com.google.ortools.sat.LinearObjective.Builder.addRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value )

Definition at line 533 of file LinearObjective.java.

◆ build()

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

Definition at line 468 of file LinearObjective.java.

◆ buildPartial()

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

Definition at line 477 of file LinearObjective.java.

◆ clear()

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

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

◆ clearField()

Builder com.google.ortools.sat.LinearObjective.Builder.clearField ( com.google.protobuf.Descriptors.FieldDescriptor field)

Definition at line 517 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 803 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 967 of file LinearObjective.java.

◆ clearOneof()

Builder com.google.ortools.sat.LinearObjective.Builder.clearOneof ( com.google.protobuf.Descriptors.OneofDescriptor oneof)

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

◆ clone()

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

Definition at line 507 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 838 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 830 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 822 of file LinearObjective.java.

◆ getDefaultInstanceForType()

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

Definition at line 463 of file LinearObjective.java.

◆ getDescriptor()

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

Definition at line 423 of file LinearObjective.java.

◆ getDescriptorForType()

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

Definition at line 458 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 718 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 701 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 684 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 928 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 988 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 910 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 980 of file LinearObjective.java.

◆ internalGetFieldAccessorTable()

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

Definition at line 429 of file LinearObjective.java.

◆ isInitialized()

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

Definition at line 584 of file LinearObjective.java.

◆ mergeFrom() [1/3]

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

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

◆ mergeFrom() [3/3]

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

Definition at line 539 of file LinearObjective.java.

◆ mergeUnknownFields()

final Builder com.google.ortools.sat.LinearObjective.Builder.mergeUnknownFields ( final com.google.protobuf.UnknownFieldSet unknownFields)

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

◆ setField()

Builder com.google.ortools.sat.LinearObjective.Builder.setField ( com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value )

Definition at line 511 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 736 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 946 of file LinearObjective.java.

◆ setRepeatedField()

Builder com.google.ortools.sat.LinearObjective.Builder.setRepeatedField ( com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value )

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

◆ setUnknownFields()

final Builder com.google.ortools.sat.LinearObjective.Builder.setUnknownFields ( final com.google.protobuf.UnknownFieldSet unknownFields)

Definition at line 1014 of file LinearObjective.java.


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