Class SavingsParameters.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<SavingsParameters.Builder>
com.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
com.google.ortools.constraintsolver.SavingsParameters.Builder
- All Implemented Interfaces:
SavingsParametersOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
- Enclosing class:
SavingsParameters
public static final class SavingsParameters.Builder
extends com.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
implements SavingsParametersOrBuilder
Parameters used to configure savings heuristics.Protobuf type
operations_research.SavingsParameters-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()Add savings related to reverse arcs when finding the nearest neighbors of the nodes.Coefficient of the cost of the arc for which the saving value is being computed: Saving(a-->b) = Cost(a-->end) + Cost(start-->b) - arc_coefficient * Cost(a-->b) This parameter must be greater than 0, and its default value is 1.The number of neighbors considered for each node in the Savings heuristic is chosen so that the space used to store the savings doesn't exceed max_memory_usage_bytes, which must be in ]0, 1e10].Ratio (in ]0, 1]) of neighbors to consider for each node when constructing the savings.booleanAdd savings related to reverse arcs when finding the nearest neighbors of the nodes.doubleCoefficient of the cost of the arc for which the saving value is being computed: Saving(a-->b) = Cost(a-->end) + Cost(start-->b) - arc_coefficient * Cost(a-->b) This parameter must be greater than 0, and its default value is 1.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptordoubleThe number of neighbors considered for each node in the Savings heuristic is chosen so that the space used to store the savings doesn't exceed max_memory_usage_bytes, which must be in ]0, 1e10].doubleRatio (in ]0, 1]) of neighbors to consider for each node when constructing the savings.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(SavingsParameters other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setAddReverseArcs(boolean value) Add savings related to reverse arcs when finding the nearest neighbors of the nodes.setArcCoefficient(double value) Coefficient of the cost of the arc for which the saving value is being computed: Saving(a-->b) = Cost(a-->end) + Cost(start-->b) - arc_coefficient * Cost(a-->b) This parameter must be greater than 0, and its default value is 1.setMaxMemoryUsageBytes(double value) The number of neighbors considered for each node in the Savings heuristic is chosen so that the space used to store the savings doesn't exceed max_memory_usage_bytes, which must be in ]0, 1e10].setNeighborsRatio(double value) Ratio (in ]0, 1]) of neighbors to consider for each node when constructing the savings.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<SavingsParameters.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.GeneratedMessage.Builder<SavingsParameters.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<SavingsParameters.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
-
mergeFrom
public SavingsParameters.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<SavingsParameters.Builder>- Throws:
IOException
-
getNeighborsRatio
public double getNeighborsRatio()Ratio (in ]0, 1]) of neighbors to consider for each node when constructing the savings. If unspecified, its value is considered to be 1.0.
double neighbors_ratio = 1;- Specified by:
getNeighborsRatioin interfaceSavingsParametersOrBuilder- Returns:
- The neighborsRatio.
-
setNeighborsRatio
Ratio (in ]0, 1]) of neighbors to consider for each node when constructing the savings. If unspecified, its value is considered to be 1.0.
double neighbors_ratio = 1;- Parameters:
value- The neighborsRatio to set.- Returns:
- This builder for chaining.
-
clearNeighborsRatio
Ratio (in ]0, 1]) of neighbors to consider for each node when constructing the savings. If unspecified, its value is considered to be 1.0.
double neighbors_ratio = 1;- Returns:
- This builder for chaining.
-
getMaxMemoryUsageBytes
public double getMaxMemoryUsageBytes()The number of neighbors considered for each node in the Savings heuristic is chosen so that the space used to store the savings doesn't exceed max_memory_usage_bytes, which must be in ]0, 1e10]. NOTE: If both neighbors_ratio and max_memory_usage_bytes are specified, the number of neighbors considered for each node will be the minimum of the two numbers determined by these parameters.
double max_memory_usage_bytes = 2;- Specified by:
getMaxMemoryUsageBytesin interfaceSavingsParametersOrBuilder- Returns:
- The maxMemoryUsageBytes.
-
setMaxMemoryUsageBytes
The number of neighbors considered for each node in the Savings heuristic is chosen so that the space used to store the savings doesn't exceed max_memory_usage_bytes, which must be in ]0, 1e10]. NOTE: If both neighbors_ratio and max_memory_usage_bytes are specified, the number of neighbors considered for each node will be the minimum of the two numbers determined by these parameters.
double max_memory_usage_bytes = 2;- Parameters:
value- The maxMemoryUsageBytes to set.- Returns:
- This builder for chaining.
-
clearMaxMemoryUsageBytes
The number of neighbors considered for each node in the Savings heuristic is chosen so that the space used to store the savings doesn't exceed max_memory_usage_bytes, which must be in ]0, 1e10]. NOTE: If both neighbors_ratio and max_memory_usage_bytes are specified, the number of neighbors considered for each node will be the minimum of the two numbers determined by these parameters.
double max_memory_usage_bytes = 2;- Returns:
- This builder for chaining.
-
getAddReverseArcs
public boolean getAddReverseArcs()Add savings related to reverse arcs when finding the nearest neighbors of the nodes.
bool add_reverse_arcs = 3;- Specified by:
getAddReverseArcsin interfaceSavingsParametersOrBuilder- Returns:
- The addReverseArcs.
-
setAddReverseArcs
Add savings related to reverse arcs when finding the nearest neighbors of the nodes.
bool add_reverse_arcs = 3;- Parameters:
value- The addReverseArcs to set.- Returns:
- This builder for chaining.
-
clearAddReverseArcs
Add savings related to reverse arcs when finding the nearest neighbors of the nodes.
bool add_reverse_arcs = 3;- Returns:
- This builder for chaining.
-
getArcCoefficient
public double getArcCoefficient()Coefficient of the cost of the arc for which the saving value is being computed: Saving(a-->b) = Cost(a-->end) + Cost(start-->b) - arc_coefficient * Cost(a-->b) This parameter must be greater than 0, and its default value is 1.
double arc_coefficient = 4;- Specified by:
getArcCoefficientin interfaceSavingsParametersOrBuilder- Returns:
- The arcCoefficient.
-
setArcCoefficient
Coefficient of the cost of the arc for which the saving value is being computed: Saving(a-->b) = Cost(a-->end) + Cost(start-->b) - arc_coefficient * Cost(a-->b) This parameter must be greater than 0, and its default value is 1.
double arc_coefficient = 4;- Parameters:
value- The arcCoefficient to set.- Returns:
- This builder for chaining.
-
clearArcCoefficient
Coefficient of the cost of the arc for which the saving value is being computed: Saving(a-->b) = Cost(a-->end) + Cost(start-->b) - arc_coefficient * Cost(a-->b) This parameter must be greater than 0, and its default value is 1.
double arc_coefficient = 4;- Returns:
- This builder for chaining.
-