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 Type
    Method
    Description
     
     
     
    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.
    boolean
    Add savings related to reverse arcs when finding the nearest neighbors of the nodes.
    double
    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.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    double
    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].
    double
    Ratio (in ]0, 1]) of neighbors to consider for each node when constructing the savings.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    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, 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 Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods 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:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
    • clear

      public SavingsParameters.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<SavingsParameters.Builder>
    • getDefaultInstanceForType

      public SavingsParameters getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public SavingsParameters build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public SavingsParameters buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public SavingsParameters.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<SavingsParameters.Builder>
    • mergeFrom

      public SavingsParameters.Builder mergeFrom(SavingsParameters other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.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:
      getNeighborsRatio in interface SavingsParametersOrBuilder
      Returns:
      The neighborsRatio.
    • setNeighborsRatio

      public SavingsParameters.Builder setNeighborsRatio(double value)
      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

      public SavingsParameters.Builder 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:
      getMaxMemoryUsageBytes in interface SavingsParametersOrBuilder
      Returns:
      The maxMemoryUsageBytes.
    • setMaxMemoryUsageBytes

      public SavingsParameters.Builder 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].
      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

      public SavingsParameters.Builder 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:
      getAddReverseArcs in interface SavingsParametersOrBuilder
      Returns:
      The addReverseArcs.
    • setAddReverseArcs

      public SavingsParameters.Builder setAddReverseArcs(boolean value)
      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

      public SavingsParameters.Builder 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:
      getArcCoefficient in interface SavingsParametersOrBuilder
      Returns:
      The arcCoefficient.
    • setArcCoefficient

      public SavingsParameters.Builder 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.
      
      double arc_coefficient = 4;
      Parameters:
      value - The arcCoefficient to set.
      Returns:
      This builder for chaining.
    • clearArcCoefficient

      public SavingsParameters.Builder 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.