Class Vehicle.DurationLimit

  • All Implemented Interfaces:
    Vehicle.DurationLimitOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable
    Enclosing class:
    Vehicle

    public static final class Vehicle.DurationLimit
    extends com.google.protobuf.GeneratedMessageV3
    implements Vehicle.DurationLimitOrBuilder
     A limit defining a maximum duration of the route of a vehicle. It can be
     either hard or soft.
    
     When a soft limit field is defined, both the soft max threshold and its
     associated cost must be defined together.
     
    Protobuf type google.cloud.optimization.v1.Vehicle.DurationLimit
    See Also:
    Serialized Form
    • Field Detail

      • MAX_DURATION_FIELD_NUMBER

        public static final int MAX_DURATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SOFT_MAX_DURATION_FIELD_NUMBER

        public static final int SOFT_MAX_DURATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER

        public static final int COST_PER_HOUR_AFTER_SOFT_MAX_FIELD_NUMBER
        See Also:
        Constant Field Values
      • QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER

        public static final int QUADRATIC_SOFT_MAX_DURATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER

        public static final int COST_PER_SQUARE_HOUR_AFTER_QUADRATIC_SOFT_MAX_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • hasMaxDuration

        public boolean hasMaxDuration()
         A hard limit constraining the duration to be at most max_duration.
         
        .google.protobuf.Duration max_duration = 1;
        Specified by:
        hasMaxDuration in interface Vehicle.DurationLimitOrBuilder
        Returns:
        Whether the maxDuration field is set.
      • getMaxDuration

        public com.google.protobuf.Duration getMaxDuration()
         A hard limit constraining the duration to be at most max_duration.
         
        .google.protobuf.Duration max_duration = 1;
        Specified by:
        getMaxDuration in interface Vehicle.DurationLimitOrBuilder
        Returns:
        The maxDuration.
      • getMaxDurationOrBuilder

        public com.google.protobuf.DurationOrBuilder getMaxDurationOrBuilder()
         A hard limit constraining the duration to be at most max_duration.
         
        .google.protobuf.Duration max_duration = 1;
        Specified by:
        getMaxDurationOrBuilder in interface Vehicle.DurationLimitOrBuilder
      • hasSoftMaxDuration

        public boolean hasSoftMaxDuration()
         A soft limit not enforcing a maximum duration limit, but when violated
         makes the route incur a cost. This cost adds up to other costs defined in
         the model, with the same unit.
        
         If defined, `soft_max_duration` must be nonnegative. If max_duration is
         also defined, `soft_max_duration` must be less than max_duration.
         
        .google.protobuf.Duration soft_max_duration = 2;
        Specified by:
        hasSoftMaxDuration in interface Vehicle.DurationLimitOrBuilder
        Returns:
        Whether the softMaxDuration field is set.
      • getSoftMaxDuration

        public com.google.protobuf.Duration getSoftMaxDuration()
         A soft limit not enforcing a maximum duration limit, but when violated
         makes the route incur a cost. This cost adds up to other costs defined in
         the model, with the same unit.
        
         If defined, `soft_max_duration` must be nonnegative. If max_duration is
         also defined, `soft_max_duration` must be less than max_duration.
         
        .google.protobuf.Duration soft_max_duration = 2;
        Specified by:
        getSoftMaxDuration in interface Vehicle.DurationLimitOrBuilder
        Returns:
        The softMaxDuration.
      • getSoftMaxDurationOrBuilder

        public com.google.protobuf.DurationOrBuilder getSoftMaxDurationOrBuilder()
         A soft limit not enforcing a maximum duration limit, but when violated
         makes the route incur a cost. This cost adds up to other costs defined in
         the model, with the same unit.
        
         If defined, `soft_max_duration` must be nonnegative. If max_duration is
         also defined, `soft_max_duration` must be less than max_duration.
         
        .google.protobuf.Duration soft_max_duration = 2;
        Specified by:
        getSoftMaxDurationOrBuilder in interface Vehicle.DurationLimitOrBuilder
      • hasCostPerHourAfterSoftMax

        public boolean hasCostPerHourAfterSoftMax()
         Cost per hour incurred if the `soft_max_duration` threshold is violated.
         The additional cost is 0 if the duration is under the threshold,
         otherwise the cost depends on the duration as follows:
         ```
           cost_per_hour_after_soft_max * (duration - soft_max_duration)
         ```
         The cost must be nonnegative.
         
        optional double cost_per_hour_after_soft_max = 3;
        Specified by:
        hasCostPerHourAfterSoftMax in interface Vehicle.DurationLimitOrBuilder
        Returns:
        Whether the costPerHourAfterSoftMax field is set.
      • getCostPerHourAfterSoftMax

        public double getCostPerHourAfterSoftMax()
         Cost per hour incurred if the `soft_max_duration` threshold is violated.
         The additional cost is 0 if the duration is under the threshold,
         otherwise the cost depends on the duration as follows:
         ```
           cost_per_hour_after_soft_max * (duration - soft_max_duration)
         ```
         The cost must be nonnegative.
         
        optional double cost_per_hour_after_soft_max = 3;
        Specified by:
        getCostPerHourAfterSoftMax in interface Vehicle.DurationLimitOrBuilder
        Returns:
        The costPerHourAfterSoftMax.
      • hasQuadraticSoftMaxDuration

        public boolean hasQuadraticSoftMaxDuration()
         A soft limit not enforcing a maximum duration limit, but when violated
         makes the route incur a cost, quadratic in the duration. This cost adds
         up to other costs defined in the model, with the same unit.
        
         If defined, `quadratic_soft_max_duration` must be nonnegative. If
         `max_duration` is also defined, `quadratic_soft_max_duration` must be
         less than `max_duration`, and the difference must be no larger than one
         day:
        
            `max_duration - quadratic_soft_max_duration <= 86400 seconds`
         
        .google.protobuf.Duration quadratic_soft_max_duration = 4;
        Specified by:
        hasQuadraticSoftMaxDuration in interface Vehicle.DurationLimitOrBuilder
        Returns:
        Whether the quadraticSoftMaxDuration field is set.
      • getQuadraticSoftMaxDuration

        public com.google.protobuf.Duration getQuadraticSoftMaxDuration()
         A soft limit not enforcing a maximum duration limit, but when violated
         makes the route incur a cost, quadratic in the duration. This cost adds
         up to other costs defined in the model, with the same unit.
        
         If defined, `quadratic_soft_max_duration` must be nonnegative. If
         `max_duration` is also defined, `quadratic_soft_max_duration` must be
         less than `max_duration`, and the difference must be no larger than one
         day:
        
            `max_duration - quadratic_soft_max_duration <= 86400 seconds`
         
        .google.protobuf.Duration quadratic_soft_max_duration = 4;
        Specified by:
        getQuadraticSoftMaxDuration in interface Vehicle.DurationLimitOrBuilder
        Returns:
        The quadraticSoftMaxDuration.
      • getQuadraticSoftMaxDurationOrBuilder

        public com.google.protobuf.DurationOrBuilder getQuadraticSoftMaxDurationOrBuilder()
         A soft limit not enforcing a maximum duration limit, but when violated
         makes the route incur a cost, quadratic in the duration. This cost adds
         up to other costs defined in the model, with the same unit.
        
         If defined, `quadratic_soft_max_duration` must be nonnegative. If
         `max_duration` is also defined, `quadratic_soft_max_duration` must be
         less than `max_duration`, and the difference must be no larger than one
         day:
        
            `max_duration - quadratic_soft_max_duration <= 86400 seconds`
         
        .google.protobuf.Duration quadratic_soft_max_duration = 4;
        Specified by:
        getQuadraticSoftMaxDurationOrBuilder in interface Vehicle.DurationLimitOrBuilder
      • hasCostPerSquareHourAfterQuadraticSoftMax

        public boolean hasCostPerSquareHourAfterQuadraticSoftMax()
         Cost per square hour incurred if the
         `quadratic_soft_max_duration` threshold is violated.
        
         The additional cost is 0 if the duration is under the threshold,
         otherwise the cost depends on the duration as follows:
        
         ```
           cost_per_square_hour_after_quadratic_soft_max *
           (duration - quadratic_soft_max_duration)^2
         ```
        
         The cost must be nonnegative.
         
        optional double cost_per_square_hour_after_quadratic_soft_max = 5;
        Specified by:
        hasCostPerSquareHourAfterQuadraticSoftMax in interface Vehicle.DurationLimitOrBuilder
        Returns:
        Whether the costPerSquareHourAfterQuadraticSoftMax field is set.
      • getCostPerSquareHourAfterQuadraticSoftMax

        public double getCostPerSquareHourAfterQuadraticSoftMax()
         Cost per square hour incurred if the
         `quadratic_soft_max_duration` threshold is violated.
        
         The additional cost is 0 if the duration is under the threshold,
         otherwise the cost depends on the duration as follows:
        
         ```
           cost_per_square_hour_after_quadratic_soft_max *
           (duration - quadratic_soft_max_duration)^2
         ```
        
         The cost must be nonnegative.
         
        optional double cost_per_square_hour_after_quadratic_soft_max = 5;
        Specified by:
        getCostPerSquareHourAfterQuadraticSoftMax in interface Vehicle.DurationLimitOrBuilder
        Returns:
        The costPerSquareHourAfterQuadraticSoftMax.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Vehicle.DurationLimit parseFrom​(ByteBuffer data)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Vehicle.DurationLimit parseFrom​(ByteBuffer data,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Vehicle.DurationLimit parseFrom​(com.google.protobuf.ByteString data)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Vehicle.DurationLimit parseFrom​(com.google.protobuf.ByteString data,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Vehicle.DurationLimit parseFrom​(byte[] data)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Vehicle.DurationLimit parseFrom​(byte[] data,
                                                      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                               throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • newBuilderForType

        public Vehicle.DurationLimit.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Vehicle.DurationLimit.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Vehicle.DurationLimit.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<Vehicle.DurationLimit> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Vehicle.DurationLimit getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder