Package com.google.ortools.sat
Class LinearObjective.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
- com.google.ortools.sat.LinearObjective.Builder
-
- All Implemented Interfaces:
LinearObjectiveOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,java.lang.Cloneable
- Enclosing class:
- LinearObjective
public static final class LinearObjective.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder> implements LinearObjectiveOrBuilder
The objective of an optimization problem.
Protobuf typeoperations_research.sat.LinearObjective
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LinearObjective.BuilderaddAllCoefficients(java.lang.Iterable<? extends java.lang.Long> values)repeated int64 coefficients = 2;LinearObjective.BuilderaddAllLiterals(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.LinearObjective.BuilderaddCoefficients(long value)repeated int64 coefficients = 2;LinearObjective.BuilderaddLiterals(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.LinearObjective.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)LinearObjectivebuild()LinearObjectivebuildPartial()LinearObjective.Builderclear()LinearObjective.BuilderclearCoefficients()repeated int64 coefficients = 2;LinearObjective.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)LinearObjective.BuilderclearLiterals()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.LinearObjective.BuilderclearOffset()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.LinearObjective.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)LinearObjective.BuilderclearScalingFactor()optional double scaling_factor = 4 [default = 1];LinearObjective.Builderclone()longgetCoefficients(int index)repeated int64 coefficients = 2;intgetCoefficientsCount()repeated int64 coefficients = 2;java.util.List<java.lang.Long>getCoefficientsList()repeated int64 coefficients = 2;LinearObjectivegetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()intgetLiterals(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.intgetLiteralsCount()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.java.util.List<java.lang.Integer>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.doublegetOffset()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.doublegetScalingFactor()optional double scaling_factor = 4 [default = 1];booleanhasOffset()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.booleanhasScalingFactor()optional double scaling_factor = 4 [default = 1];protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()LinearObjective.BuildermergeFrom(LinearObjective other)LinearObjective.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)LinearObjective.BuildermergeFrom(com.google.protobuf.Message other)LinearObjective.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)LinearObjective.BuildersetCoefficients(int index, long value)repeated int64 coefficients = 2;LinearObjective.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)LinearObjective.BuildersetLiterals(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.LinearObjective.BuildersetOffset(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.LinearObjective.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)LinearObjective.BuildersetScalingFactor(double value)optional double scaling_factor = 4 [default = 1];LinearObjective.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
clear
public LinearObjective.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
getDefaultInstanceForType
public LinearObjective getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public LinearObjective build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public LinearObjective buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public LinearObjective.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
setField
public LinearObjective.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
clearField
public LinearObjective.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
clearOneof
public LinearObjective.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
setRepeatedField
public LinearObjective.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
addRepeatedField
public LinearObjective.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
mergeFrom
public LinearObjective.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LinearObjective.Builder>
-
mergeFrom
public LinearObjective.Builder mergeFrom(LinearObjective other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
mergeFrom
public LinearObjective.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<LinearObjective.Builder>- Throws:
java.io.IOException
-
getLiteralsList
public java.util.List<java.lang.Integer> 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;- Specified by:
getLiteralsListin interfaceLinearObjectiveOrBuilder- Returns:
- A list containing the literals.
-
getLiteralsCount
public int 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;- Specified by:
getLiteralsCountin interfaceLinearObjectiveOrBuilder- Returns:
- The count of literals.
-
getLiterals
public int 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;- Specified by:
getLiteralsin interfaceLinearObjectiveOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The literals at the given index.
-
setLiterals
public 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:
index- The index to set the value at.value- The literals to set.- Returns:
- This builder for chaining.
-
addLiterals
public 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:
value- The literals to add.- Returns:
- This builder for chaining.
-
addAllLiterals
public 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:
values- The literals to add.- Returns:
- This builder for chaining.
-
clearLiterals
public 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.
-
getCoefficientsList
public java.util.List<java.lang.Long> getCoefficientsList()
repeated int64 coefficients = 2;- Specified by:
getCoefficientsListin interfaceLinearObjectiveOrBuilder- Returns:
- A list containing the coefficients.
-
getCoefficientsCount
public int getCoefficientsCount()
repeated int64 coefficients = 2;- Specified by:
getCoefficientsCountin interfaceLinearObjectiveOrBuilder- Returns:
- The count of coefficients.
-
getCoefficients
public long getCoefficients(int index)
repeated int64 coefficients = 2;- Specified by:
getCoefficientsin interfaceLinearObjectiveOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The coefficients at the given index.
-
setCoefficients
public LinearObjective.Builder setCoefficients(int index, long value)
repeated int64 coefficients = 2;- Parameters:
index- The index to set the value at.value- The coefficients to set.- Returns:
- This builder for chaining.
-
addCoefficients
public LinearObjective.Builder addCoefficients(long value)
repeated int64 coefficients = 2;- Parameters:
value- The coefficients to add.- Returns:
- This builder for chaining.
-
addAllCoefficients
public LinearObjective.Builder addAllCoefficients(java.lang.Iterable<? extends java.lang.Long> values)
repeated int64 coefficients = 2;- Parameters:
values- The coefficients to add.- Returns:
- This builder for chaining.
-
clearCoefficients
public LinearObjective.Builder clearCoefficients()
repeated int64 coefficients = 2;- Returns:
- This builder for chaining.
-
hasOffset
public boolean 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];- Specified by:
hasOffsetin interfaceLinearObjectiveOrBuilder- Returns:
- Whether the offset field is set.
-
getOffset
public double 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];- Specified by:
getOffsetin interfaceLinearObjectiveOrBuilder- Returns:
- The offset.
-
setOffset
public 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:
value- The offset to set.- Returns:
- This builder for chaining.
-
clearOffset
public 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.
-
hasScalingFactor
public boolean hasScalingFactor()
optional double scaling_factor = 4 [default = 1];- Specified by:
hasScalingFactorin interfaceLinearObjectiveOrBuilder- Returns:
- Whether the scalingFactor field is set.
-
getScalingFactor
public double getScalingFactor()
optional double scaling_factor = 4 [default = 1];- Specified by:
getScalingFactorin interfaceLinearObjectiveOrBuilder- Returns:
- The scalingFactor.
-
setScalingFactor
public LinearObjective.Builder setScalingFactor(double value)
optional double scaling_factor = 4 [default = 1];- Parameters:
value- The scalingFactor to set.- Returns:
- This builder for chaining.
-
clearScalingFactor
public LinearObjective.Builder clearScalingFactor()
optional double scaling_factor = 4 [default = 1];- Returns:
- This builder for chaining.
-
setUnknownFields
public final LinearObjective.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
mergeUnknownFields
public final LinearObjective.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<LinearObjective.Builder>
-
-