Class: Google::Cloud::Optimization::V1::BreakRule

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/optimization/v1/fleet_routing.rb

Overview

Rules to generate time breaks for a vehicle (e.g. lunch breaks). A break is a contiguous period of time during which the vehicle remains idle at its current position and cannot perform any visit. A break may occur:

  • during the travel between two visits (which includes the time right before or right after a visit, but not in the middle of a visit), in which case it extends the corresponding transit time between the visits,
  • or before the vehicle start (the vehicle may not start in the middle of a break), in which case it does not affect the vehicle start time.
  • or after the vehicle end (ditto, with the vehicle end time).

Defined Under Namespace

Classes: BreakRequest, FrequencyConstraint

Instance Attribute Summary collapse

Instance Attribute Details

#break_requests::Array<::Google::Cloud::Optimization::V1::BreakRule::BreakRequest>

Returns Sequence of breaks. See the BreakRequest message.

Returns:



1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 1715

class BreakRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # The sequence of breaks (i.e. their number and order) that apply to each
  # vehicle must be known beforehand. The repeated `BreakRequest`s define
  # that sequence, in the order in which they must occur. Their time windows
  # (`earliest_start_time` / `latest_start_time`) may overlap, but they must
  # be compatible with the order (this is checked).
  # @!attribute [rw] earliest_start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Required. Lower bound (inclusive) on the start of the break.
  # @!attribute [rw] latest_start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Required. Upper bound (inclusive) on the start of the break.
  # @!attribute [rw] min_duration
  #   @return [::Google::Protobuf::Duration]
  #     Required. Minimum duration of the break. Must be positive.
  class BreakRequest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # One may further constrain the frequency and duration of the breaks
  # specified above, by enforcing a minimum break frequency, such as
  # "There must be a break of at least 1 hour every 12 hours". Assuming that
  # this can be interpreted as "Within any sliding time window of 12h, there
  # must be at least one break of at least one hour", that example would
  # translate to the following `FrequencyConstraint`:
  # ```
  # {
  #    min_break_duration { seconds: 3600 }         # 1 hour.
  #    max_inter_break_duration { seconds: 39600 }  # 11 hours (12 - 1 = 11).
  # }
  # ```
  #
  # The timing and duration of the breaks in the solution will respect all
  # such constraints, in addition to the time windows and minimum durations
  # already specified in the `BreakRequest`.
  #
  # A `FrequencyConstraint` may in practice apply to non-consecutive breaks.
  # For example, the following schedule honors the "1h every 12h" example:
  # ```
  #   04:00 vehicle start
  #    .. performing travel and visits ..
  #   09:00 1 hour break
  #   10:00 end of the break
  #    .. performing travel and visits ..
  #   12:00 20-min lunch break
  #   12:20 end of the break
  #    .. performing travel and visits ..
  #   21:00 1 hour break
  #   22:00 end of the break
  #    .. performing travel and visits ..
  #   23:59 vehicle end
  # ```
  # @!attribute [rw] min_break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Required. Minimum break duration for this constraint. Nonnegative.
  #     See description of `FrequencyConstraint`.
  # @!attribute [rw] max_inter_break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Required. Maximum allowed span of any interval of time in the route that
  #     does not include at least partially a break of `duration >=
  #     min_break_duration`. Must be positive.
  class FrequencyConstraint
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#frequency_constraints::Array<::Google::Cloud::Optimization::V1::BreakRule::FrequencyConstraint>

Returns Several FrequencyConstraint may apply. They must all be satisfied by the BreakRequests of this BreakRule. See FrequencyConstraint.

Returns:



1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 1715

class BreakRule
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # The sequence of breaks (i.e. their number and order) that apply to each
  # vehicle must be known beforehand. The repeated `BreakRequest`s define
  # that sequence, in the order in which they must occur. Their time windows
  # (`earliest_start_time` / `latest_start_time`) may overlap, but they must
  # be compatible with the order (this is checked).
  # @!attribute [rw] earliest_start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Required. Lower bound (inclusive) on the start of the break.
  # @!attribute [rw] latest_start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Required. Upper bound (inclusive) on the start of the break.
  # @!attribute [rw] min_duration
  #   @return [::Google::Protobuf::Duration]
  #     Required. Minimum duration of the break. Must be positive.
  class BreakRequest
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # One may further constrain the frequency and duration of the breaks
  # specified above, by enforcing a minimum break frequency, such as
  # "There must be a break of at least 1 hour every 12 hours". Assuming that
  # this can be interpreted as "Within any sliding time window of 12h, there
  # must be at least one break of at least one hour", that example would
  # translate to the following `FrequencyConstraint`:
  # ```
  # {
  #    min_break_duration { seconds: 3600 }         # 1 hour.
  #    max_inter_break_duration { seconds: 39600 }  # 11 hours (12 - 1 = 11).
  # }
  # ```
  #
  # The timing and duration of the breaks in the solution will respect all
  # such constraints, in addition to the time windows and minimum durations
  # already specified in the `BreakRequest`.
  #
  # A `FrequencyConstraint` may in practice apply to non-consecutive breaks.
  # For example, the following schedule honors the "1h every 12h" example:
  # ```
  #   04:00 vehicle start
  #    .. performing travel and visits ..
  #   09:00 1 hour break
  #   10:00 end of the break
  #    .. performing travel and visits ..
  #   12:00 20-min lunch break
  #   12:20 end of the break
  #    .. performing travel and visits ..
  #   21:00 1 hour break
  #   22:00 end of the break
  #    .. performing travel and visits ..
  #   23:59 vehicle end
  # ```
  # @!attribute [rw] min_break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Required. Minimum break duration for this constraint. Nonnegative.
  #     See description of `FrequencyConstraint`.
  # @!attribute [rw] max_inter_break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Required. Maximum allowed span of any interval of time in the route that
  #     does not include at least partially a break of `duration >=
  #     min_break_duration`. Must be positive.
  class FrequencyConstraint
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end