Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPVariableProto.Builder Class Reference

Detailed Description

A variable is always constrained in the form:
lower_bound <= x <= upper_bound
where lower_bound and upper_bound:
- Can form a singleton: x = constant = lower_bound = upper_bound.
- Can form a finite interval: lower_bound <= x <= upper_bound. (x is boxed.)
- Can form a semi-infinite interval.
- lower_bound = -infinity: x <= upper_bound.
- upper_bound = +infinity: x >= lower_bound.
- Can form the infinite interval: lower_bound = -infinity and
upper_bound = +infinity, x is free.
MPVariableProto furthermore stores:
- The coefficient of the variable in the objective.
- Whether the variable is integer.

Protobuf type operations_research.MPVariableProto

Definition at line 515 of file MPVariableProto.java.

Inheritance diagram for com.google.ortools.linearsolver.MPVariableProto.Builder:
com.google.ortools.linearsolver.MPVariableProtoOrBuilder

Public Member Functions

Builder clear ()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType ()
com.google.ortools.linearsolver.MPVariableProto getDefaultInstanceForType ()
com.google.ortools.linearsolver.MPVariableProto build ()
com.google.ortools.linearsolver.MPVariableProto buildPartial ()
Builder mergeFrom (com.google.protobuf.Message other)
Builder mergeFrom (com.google.ortools.linearsolver.MPVariableProto other)
final boolean isInitialized ()
Builder mergeFrom (com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
boolean hasLowerBound ()
double getLowerBound ()
Builder setLowerBound (double value)
Builder clearLowerBound ()
boolean hasUpperBound ()
double getUpperBound ()
Builder setUpperBound (double value)
Builder clearUpperBound ()
boolean hasObjectiveCoefficient ()
double getObjectiveCoefficient ()
Builder setObjectiveCoefficient (double value)
Builder clearObjectiveCoefficient ()
boolean hasIsInteger ()
boolean getIsInteger ()
Builder setIsInteger (boolean value)
Builder clearIsInteger ()
boolean hasName ()
java.lang.String getName ()
com.google.protobuf.ByteString getNameBytes ()
Builder setName (java.lang.String value)
Builder clearName ()
Builder setNameBytes (com.google.protobuf.ByteString value)
boolean hasBranchingPriority ()
int getBranchingPriority ()
Builder setBranchingPriority (int value)
Builder clearBranchingPriority ()

Static Public Member Functions

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

Protected Member Functions

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

Member Function Documentation

◆ build()

com.google.ortools.linearsolver.MPVariableProto com.google.ortools.linearsolver.MPVariableProto.Builder.build ( )

Definition at line 567 of file MPVariableProto.java.

◆ buildPartial()

com.google.ortools.linearsolver.MPVariableProto com.google.ortools.linearsolver.MPVariableProto.Builder.buildPartial ( )

Definition at line 576 of file MPVariableProto.java.

◆ clear()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clear ( )

Definition at line 543 of file MPVariableProto.java.

◆ clearBranchingPriority()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clearBranchingPriority ( )

optional int32 branching_priority = 6 [default = 0];

Returns
This builder for chaining.

Definition at line 1067 of file MPVariableProto.java.

◆ clearIsInteger()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clearIsInteger ( )
True if the variable is constrained to be integer.
Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.

optional bool is_integer = 4 [default = false];

Returns
This builder for chaining.

Definition at line 923 of file MPVariableProto.java.

◆ clearLowerBound()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clearLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 1 [default = -inf];

Returns
This builder for chaining.

Definition at line 767 of file MPVariableProto.java.

◆ clearName()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clearName ( )
The name of the variable.

optional string name = 5 [default = ""];

Returns
This builder for chaining.

Definition at line 1010 of file MPVariableProto.java.

◆ clearObjectiveCoefficient()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clearObjectiveCoefficient ( )
The coefficient of the variable in the objective. Must be finite.

optional double objective_coefficient = 3 [default = 0];

Returns
This builder for chaining.

Definition at line 863 of file MPVariableProto.java.

◆ clearUpperBound()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.clearUpperBound ( )

optional double upper_bound = 2 [default = inf];

Returns
This builder for chaining.

Definition at line 807 of file MPVariableProto.java.

◆ getBranchingPriority()

int com.google.ortools.linearsolver.MPVariableProto.Builder.getBranchingPriority ( )

optional int32 branching_priority = 6 [default = 0];

Returns
The branchingPriority.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 1048 of file MPVariableProto.java.

◆ getDefaultInstanceForType()

com.google.ortools.linearsolver.MPVariableProto com.google.ortools.linearsolver.MPVariableProto.Builder.getDefaultInstanceForType ( )

Definition at line 562 of file MPVariableProto.java.

◆ getDescriptor()

final com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPVariableProto.Builder.getDescriptor ( )
static

Definition at line 520 of file MPVariableProto.java.

◆ getDescriptorForType()

com.google.protobuf.Descriptors.Descriptor com.google.ortools.linearsolver.MPVariableProto.Builder.getDescriptorForType ( )

Definition at line 557 of file MPVariableProto.java.

◆ getIsInteger()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.getIsInteger ( )
True if the variable is constrained to be integer.
Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.

optional bool is_integer = 4 [default = false];

Returns
The isInteger.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 894 of file MPVariableProto.java.

◆ getLowerBound()

double com.google.ortools.linearsolver.MPVariableProto.Builder.getLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 1 [default = -inf];

Returns
The lowerBound.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 740 of file MPVariableProto.java.

◆ getName()

java.lang.String com.google.ortools.linearsolver.MPVariableProto.Builder.getName ( )
The name of the variable.

optional string name = 5 [default = ""];

Returns
The name.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 950 of file MPVariableProto.java.

◆ getNameBytes()

com.google.protobuf.ByteString com.google.ortools.linearsolver.MPVariableProto.Builder.getNameBytes ( )
The name of the variable.

optional string name = 5 [default = ""];

Returns
The bytes for name.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 973 of file MPVariableProto.java.

◆ getObjectiveCoefficient()

double com.google.ortools.linearsolver.MPVariableProto.Builder.getObjectiveCoefficient ( )
The coefficient of the variable in the objective. Must be finite.

optional double objective_coefficient = 3 [default = 0];

Returns
The objectiveCoefficient.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 836 of file MPVariableProto.java.

◆ getUpperBound()

double com.google.ortools.linearsolver.MPVariableProto.Builder.getUpperBound ( )

optional double upper_bound = 2 [default = inf];

Returns
The upperBound.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 788 of file MPVariableProto.java.

◆ hasBranchingPriority()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.hasBranchingPriority ( )

optional int32 branching_priority = 6 [default = 0];

Returns
Whether the branchingPriority field is set.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 1040 of file MPVariableProto.java.

◆ hasIsInteger()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.hasIsInteger ( )
True if the variable is constrained to be integer.
Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.

optional bool is_integer = 4 [default = false];

Returns
Whether the isInteger field is set.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 881 of file MPVariableProto.java.

◆ hasLowerBound()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.hasLowerBound ( )
lower_bound must be <= upper_bound.

optional double lower_bound = 1 [default = -inf];

Returns
Whether the lowerBound field is set.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 728 of file MPVariableProto.java.

◆ hasName()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.hasName ( )
The name of the variable.

optional string name = 5 [default = ""];

Returns
Whether the name field is set.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 939 of file MPVariableProto.java.

◆ hasObjectiveCoefficient()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.hasObjectiveCoefficient ( )
The coefficient of the variable in the objective. Must be finite.

optional double objective_coefficient = 3 [default = 0];

Returns
Whether the objectiveCoefficient field is set.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 824 of file MPVariableProto.java.

◆ hasUpperBound()

boolean com.google.ortools.linearsolver.MPVariableProto.Builder.hasUpperBound ( )

optional double upper_bound = 2 [default = inf];

Returns
Whether the upperBound field is set.

Implements com.google.ortools.linearsolver.MPVariableProtoOrBuilder.

Definition at line 780 of file MPVariableProto.java.

◆ internalGetFieldAccessorTable()

com.google.protobuf.GeneratedMessage.FieldAccessorTable com.google.ortools.linearsolver.MPVariableProto.Builder.internalGetFieldAccessorTable ( )
protected

Definition at line 526 of file MPVariableProto.java.

◆ isInitialized()

final boolean com.google.ortools.linearsolver.MPVariableProto.Builder.isInitialized ( )

Definition at line 651 of file MPVariableProto.java.

◆ mergeFrom() [1/3]

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.mergeFrom ( com.google.ortools.linearsolver.MPVariableProto other)

Definition at line 623 of file MPVariableProto.java.

◆ mergeFrom() [2/3]

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

Definition at line 656 of file MPVariableProto.java.

◆ mergeFrom() [3/3]

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.mergeFrom ( com.google.protobuf.Message other)

Definition at line 614 of file MPVariableProto.java.

◆ setBranchingPriority()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setBranchingPriority ( int value)

optional int32 branching_priority = 6 [default = 0];

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

Definition at line 1056 of file MPVariableProto.java.

◆ setIsInteger()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setIsInteger ( boolean value)
True if the variable is constrained to be integer.
Ignored if MPModelProto::solver_type is *LINEAR_PROGRAMMING*.

optional bool is_integer = 4 [default = false];

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

Definition at line 907 of file MPVariableProto.java.

◆ setLowerBound()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setLowerBound ( double value)
lower_bound must be <= upper_bound.

optional double lower_bound = 1 [default = -inf];

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

Definition at line 752 of file MPVariableProto.java.

◆ setName()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setName ( java.lang.String value)
The name of the variable.

optional string name = 5 [default = ""];

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

Definition at line 994 of file MPVariableProto.java.

◆ setNameBytes()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setNameBytes ( com.google.protobuf.ByteString value)
The name of the variable.

optional string name = 5 [default = ""];

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

Definition at line 1025 of file MPVariableProto.java.

◆ setObjectiveCoefficient()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setObjectiveCoefficient ( double value)
The coefficient of the variable in the objective. Must be finite.

optional double objective_coefficient = 3 [default = 0];

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

Definition at line 848 of file MPVariableProto.java.

◆ setUpperBound()

Builder com.google.ortools.linearsolver.MPVariableProto.Builder.setUpperBound ( double value)

optional double upper_bound = 2 [default = inf];

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

Definition at line 796 of file MPVariableProto.java.


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