Class: Google::Cloud::Optimization::V1::ShipmentRoute

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

A vehicle's route can be decomposed, along the time axis, like this (we assume there are n visits):

  |            |            |          |       |  T[2], |        |      |
  | Transition |  Visit #0  |          |       |  V[2], |        |      |
  |     #0     |    aka     |   T[1]   |  V[1] |  ...   | V[n-1] | T[n] |
  |  aka T[0]  |    V[0]    |          |       | V[n-2],|        |      |
  |            |            |          |       | T[n-1] |        |      |
  ^            ^            ^          ^       ^        ^        ^      ^
vehicle    V[0].start   V[0].end     V[1].   V[1].    V[n].    V[n]. vehicle
 start     (arrival)   (departure)   start   end      start    end     end

Note that we make a difference between:

  • "punctual events", such as the vehicle start and end and each visit's start and end (aka arrival and departure). They happen at a given second.
  • "time intervals", such as the visits themselves, and the transition between visits. Though time intervals can sometimes have zero duration, i.e. start and end at the same second, they often have a positive duration.

Invariants:

  • If there are n visits, there are n+1 transitions.
  • A visit is always surrounded by a transition before it (same index) and a transition after it (index + 1).
  • The vehicle start is always followed by transition #0.
  • The vehicle end is always preceded by transition #n.

Zooming in, here is what happens during a Transition and a Visit:

---+-------------------------------------+-----------------------------+-->
   |           TRANSITION[i]             |           VISIT[i]          |
   |                                     |                             |
   |  * TRAVEL: the vehicle moves from   |      PERFORM the visit:     |
   |    VISIT[i-1].departure_location to |                             |
   |    VISIT[i].arrival_location, which |  * Spend some time:         |
   |    takes a given travel duration    |    the "visit duration".    |
   |    and distance                     |                             |
   |                                     |  * Load or unload           |
   |  * BREAKS: the driver may have      |    some quantities from the |
   |    breaks (e.g. lunch break).       |    vehicle: the "demand".   |
   |                                     |                             |
   |  * WAIT: the driver/vehicle does    |                             |
   |    nothing. This can happen for     |                             |
   |    many reasons, for example when   |                             |
   |    the vehicle reaches the next     |                             |
   |    event's destination before the   |                             |
   |    start of its time window         |                             |
   |                                     |                             |
   |  * DELAY: *right before* the next   |                             |
   |    arrival. E.g. the vehicle and/or |                             |
   |    driver spends time unloading.    |                             |
   |                                     |                             |
---+-------------------------------------+-----------------------------+-->
   ^                                     ^                             ^
V[i-1].end                           V[i].start                    V[i].end

Lastly, here is how the TRAVEL, BREAKS, DELAY and WAIT can be arranged during a transition.

  • They don't overlap.
  • The DELAY is unique and must be a contiguous period of time right before the next visit (or vehicle end). Thus, it suffice to know the delay duration to know its start and end time.
  • The BREAKS are contiguous, non-overlapping periods of time. The response specifies the start time and duration of each break.
  • TRAVEL and WAIT are "preemptable": they can be interrupted several times during this transition. Clients can assume that travel happens "as soon as possible" and that "wait" fills the remaining time.

A (complex) example:

                               TRANSITION[i]
--++-----+-----------------------------------------------------------++-->
  ||     |       |           |       |           |         |         ||
  ||  T  |   B   |     T     |       |     B     |         |    D    ||
  ||  r  |   r   |     r     |   W   |     r     |    W    |    e    ||
  ||  a  |   e   |     a     |   a   |     e     |    a    |    l    ||
  ||  v  |   a   |     v     |   i   |     a     |    i    |    a    ||
  ||  e  |   k   |     e     |   t   |     k     |    t    |    y    ||
  ||  l  |       |     l     |       |           |         |         ||
  ||     |       |           |       |           |         |         ||
--++-----------------------------------------------------------------++-->

Defined Under Namespace

Classes: Break, Delay, EncodedPolyline, RouteCostsEntry, Transition, TravelStep, VehicleLoad, Visit

Instance Attribute Summary collapse

Instance Attribute Details

#breaks::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::Break>

Returns Breaks scheduled for the vehicle performing this route. The breaks sequence represents time intervals, each starting at the corresponding start_time and lasting duration seconds.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#delay_before_vehicle_end::Google::Cloud::Optimization::V1::ShipmentRoute::Delay

Deprecated.

This field is deprecated and may be removed in the next major version update.

Returns Deprecated: Delay occurring before the vehicle end. See TransitionAttributes.delay.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#end_loads::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>

Deprecated.

This field is deprecated and may be removed in the next major version update.

Returns Deprecated: Use Transition.vehicle_loads instead. Vehicle loads upon arrival at its end location, for each type specified in Vehicle.capacities, start_load_intervals, end_load_intervals or demands. Exception: we omit loads for quantity types unconstrained by intervals and that don't have any non-zero demand on the route.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#has_traffic_infeasibilities::Boolean

Returns When OptimizeToursRequest.consider_road_traffic, is set to true, this field indicates that inconsistencies in route timings are predicted using traffic-based travel duration estimates. There may be insufficient time to complete traffic-adjusted travel, delays, and breaks between visits, before the first visit, or after the last visit, while still satisfying the visit and vehicle time windows. For example,

  start_time(previous_visit) + duration(previous_visit) +
  travel_duration(previous_visit, next_visit) > start_time(next_visit)

Arrival at next_visit will likely happen later than its current time window due the increased estimate of travel time travel_duration(previous_visit, next_visit) due to traffic. Also, a break may be forced to overlap with a visit due to an increase in travel time estimates and visit or break time window restrictions.

Returns:

  • (::Boolean)

    When OptimizeToursRequest.consider_road_traffic, is set to true, this field indicates that inconsistencies in route timings are predicted using traffic-based travel duration estimates. There may be insufficient time to complete traffic-adjusted travel, delays, and breaks between visits, before the first visit, or after the last visit, while still satisfying the visit and vehicle time windows. For example,

      start_time(previous_visit) + duration(previous_visit) +
      travel_duration(previous_visit, next_visit) > start_time(next_visit)
    

    Arrival at next_visit will likely happen later than its current time window due the increased estimate of travel time travel_duration(previous_visit, next_visit) due to traffic. Also, a break may be forced to overlap with a visit due to an increase in travel time estimates and visit or break time window restrictions.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#metrics::Google::Cloud::Optimization::V1::AggregatedMetrics

Returns Duration, distance and load metrics for this route. The fields of AggregatedMetrics are summed over all ShipmentRoute.transitions or ShipmentRoute.visits, depending on the context.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#route_costs::Google::Protobuf::Map{::String => ::Float}

Returns Cost of the route, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole route. In other words, costs["model.shipments.pickups.cost"] is the sum of all pickup costs over the route. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.

Returns:

  • (::Google::Protobuf::Map{::String => ::Float})

    Cost of the route, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, e.g. "model.shipments.pickups.cost", and the values are the total cost generated by the corresponding cost field, aggregated over the whole route. In other words, costs["model.shipments.pickups.cost"] is the sum of all pickup costs over the route. All costs defined in the model are reported in detail here with the exception of costs related to TransitionAttributes that are only reported in an aggregated way as of 2022/01.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#route_polyline::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline

Returns The encoded polyline representation of the route. This field is only populated if OptimizeToursRequest.populate_polylines is set to true.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#route_total_cost::Float

Returns Total cost of the route. The sum of all costs in the cost map.

Returns:

  • (::Float)

    Total cost of the route. The sum of all costs in the cost map.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#transitions::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::Transition>

Returns Ordered list of transitions for the route.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#travel_steps::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::TravelStep>

Deprecated.

This field is deprecated and may be removed in the next major version update.

Returns Deprecated: Use ShipmentRoute.transitions instead. Ordered list of travel steps for the route.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#vehicle_detour::Google::Protobuf::Duration

Deprecated.

This field is deprecated and may be removed in the next major version update.

Returns Deprecated: No longer used. This field will only be populated at the ShipmentRoute.Visit level.

This field is the extra detour time due to the shipments visited on the route.

It is equal to vehicle_end_time - vehicle_start_time - travel duration from the vehicle's start_location to its end_location.

Returns:

  • (::Google::Protobuf::Duration)

    Deprecated: No longer used. This field will only be populated at the ShipmentRoute.Visit level.

    This field is the extra detour time due to the shipments visited on the route.

    It is equal to vehicle_end_time - vehicle_start_time - travel duration from the vehicle's start_location to its end_location.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#vehicle_end_time::Google::Protobuf::Timestamp

Returns Time at which the vehicle finishes its route.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#vehicle_index::Integer

Returns Vehicle performing the route, identified by its index in the source ShipmentModel.

Returns:

  • (::Integer)

    Vehicle performing the route, identified by its index in the source ShipmentModel.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#vehicle_label::String

Returns Label of the vehicle performing this route, equal to ShipmentModel.vehicles(vehicle_index).label, if specified.

Returns:

  • (::String)

    Label of the vehicle performing this route, equal to ShipmentModel.vehicles(vehicle_index).label, if specified.



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#vehicle_start_time::Google::Protobuf::Timestamp

Returns Time at which the vehicle starts its route.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#visits::Array<::Google::Cloud::Optimization::V1::ShipmentRoute::Visit>

Returns Ordered sequence of visits representing a route. visits[i] is the i-th visit in the route. If this field is empty, the vehicle is considered as unused.

Returns:



2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
# File 'proto_docs/google/cloud/optimization/v1/fleet_routing.rb', line 2045

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

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  # instead. Time interval spent on the route resulting from a
  # {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start of the delay.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the delay.
  class Delay
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A visit performed during a route. This visit corresponds to a pickup or a
  # delivery of a `Shipment`.
  # @!attribute [rw] shipment_index
  #   @return [::Integer]
  #     Index of the `shipments` field in the source
  #     {::Google::Cloud::Optimization::V1::ShipmentModel ShipmentModel}.
  # @!attribute [rw] is_pickup
  #   @return [::Boolean]
  #     If true the visit corresponds to a pickup of a `Shipment`. Otherwise, it
  #     corresponds to a delivery.
  # @!attribute [rw] visit_request_index
  #   @return [::Integer]
  #     Index of `VisitRequest` in either the pickup or delivery field of the
  #     `Shipment` (see `is_pickup`).
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Time at which the visit starts. Note that the vehicle may arrive earlier
  #     than this at the visit location. Times are consistent with the
  #     `ShipmentModel`.
  # @!attribute [rw] load_demands
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::Shipment::Load}]
  #     Total visit load demand as the sum of the shipment and the visit request
  #     `load_demands`. The values are negative if the visit is a delivery.
  #     Demands are reported for the same types as the
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition Transition.loads}
  #     (see this field).
  # @!attribute [rw] detour
  #   @return [::Google::Protobuf::Duration]
  #     Extra detour time due to the shipments visited on the route before the
  #     visit and to the potential waiting time induced by time windows.
  #     If the visit is a delivery, the detour is computed from the corresponding
  #     pickup visit and is equal to:
  #     ```
  #     start_time(delivery) - start_time(pickup)
  #     - (duration(pickup) + travel duration from the pickup location
  #     to the delivery location).
  #     ```
  #     Otherwise, it is computed from the vehicle `start_location` and is equal
  #     to:
  #     ```
  #     start_time - vehicle_start_time - travel duration from
  #     the vehicle's `start_location` to the visit.
  #     ```
  # @!attribute [rw] shipment_label
  #   @return [::String]
  #     Copy of the corresponding `Shipment.label`, if specified in the
  #     `Shipment`.
  # @!attribute [rw] visit_label
  #   @return [::String]
  #     Copy of the corresponding
  #     {::Google::Cloud::Optimization::V1::Shipment::VisitRequest#label VisitRequest.label},
  #     if specified in the `VisitRequest`.
  # @!attribute [rw] arrival_loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead. Vehicle loads upon arrival at the visit location, for each type
  #     specified in
  #     {::Google::Cloud::Optimization::V1::Vehicle#capacities Vehicle.capacities},
  #     `start_load_intervals`, `end_load_intervals` or `demands`.
  #
  #     Exception: we omit loads for quantity types unconstrained by intervals
  #     and that don't have any non-zero demand on the route.
  # @!attribute [rw] delay_before_start
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::Delay]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#delay_duration ShipmentRoute.Transition.delay_duration}
  #     instead. Delay occurring before the visit starts.
  # @!attribute [rw] demands
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Visit#load_demands Visit.load_demands}
  #     instead.
  class Visit
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::Shipment::Load]
    class LoadDemandsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Transition between two events on the route. See the description of
  # {::Google::Cloud::Optimization::V1::ShipmentRoute ShipmentRoute}.
  #
  # If the vehicle does not have a `start_location` and/or `end_location`, the
  # corresponding travel metrics are 0.
  # @!attribute [rw] travel_duration
  #   @return [::Google::Protobuf::Duration]
  #     Travel duration during this transition.
  # @!attribute [rw] travel_distance_meters
  #   @return [::Float]
  #     Distance traveled during the transition.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     [OptimizeToursRequest.consider_road_traffic]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.consider_road_traffic],
  #     and the traffic info couldn't be retrieved for a `Transition`, this
  #     boolean is set to true. This may be temporary (rare hiccup in the
  #     realtime traffic servers) or permanent (no data for this location).
  # @!attribute [rw] delay_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the delay durations applied to this transition. If any, the delay
  #     starts exactly `delay_duration` seconds before the next event (visit or
  #     vehicle end). See
  #     {::Google::Cloud::Optimization::V1::TransitionAttributes#delay TransitionAttributes.delay}.
  # @!attribute [rw] break_duration
  #   @return [::Google::Protobuf::Duration]
  #     Sum of the duration of the breaks occurring during this transition, if
  #     any. Details about each break's start time and duration are stored in
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute#breaks ShipmentRoute.breaks}.
  # @!attribute [rw] wait_duration
  #   @return [::Google::Protobuf::Duration]
  #     Time spent waiting during this transition. Wait duration corresponds to
  #     idle time and does not include break time. Also note that this wait time
  #     may be split into several non-contiguous intervals.
  # @!attribute [rw] total_duration
  #   @return [::Google::Protobuf::Duration]
  #     Total duration of the transition, provided for convenience. It is equal
  #     to:
  #
  #     * next visit `start_time` (or `vehicle_end_time` if this is the last
  #     transition) - this transition's `start_time`;
  #     * if `ShipmentRoute.has_traffic_infeasibilities` is false, the following
  #     additionally holds: `total_duration = travel_duration + delay_duration
  #     + break_duration + wait_duration`.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of this transition.
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     transition.
  #     This field is only populated if [populate_transition_polylines]
  #     [google.cloud.optimization.v1.OptimizeToursRequest.populate_transition_polylines]
  #     is set to true.
  # @!attribute [rw] vehicle_loads
  #   @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad}]
  #     Vehicle loads during this transition, for each type that either appears
  #     in this vehicle's
  #     {::Google::Cloud::Optimization::V1::Vehicle#load_limits Vehicle.load_limits},
  #     or that have non-zero
  #     {::Google::Cloud::Optimization::V1::Shipment#load_demands Shipment.load_demands}
  #     on some shipment performed on this route.
  #
  #     The loads during the first transition are the starting loads of the
  #     vehicle route. Then, after each visit, the visit's `load_demands` are
  #     either added or subtracted to get the next transition's loads, depending
  #     on whether the visit was a pickup or a delivery.
  # @!attribute [rw] loads
  #   @deprecated This field is deprecated and may be removed in the next major version update.
  #   @return [::Array<::Google::Cloud::Optimization::V1::CapacityQuantity>]
  #     Deprecated: Use
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}
  #     instead.
  class Transition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::VehicleLoad]
    class VehicleLoadsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Reports the actual load of the vehicle at some point along the route,
  # for a given type (see
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}).
  # @!attribute [rw] amount
  #   @return [::Integer]
  #     The amount of load on the vehicle, for the given type. The unit of load
  #     is usually indicated by the type. See
  #     {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition#vehicle_loads Transition.vehicle_loads}.
  class VehicleLoad
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # The encoded representation of a polyline. More information on polyline
  # encoding can be found here:
  # https://developers.google.com/maps/documentation/utilities/polylinealgorithm
  # https://developers.google.com/maps/documentation/javascript/reference/geometry#encoding.
  # @!attribute [rw] points
  #   @return [::String]
  #     String representing encoded points of the polyline.
  class EncodedPolyline
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Data representing the execution of a break.
  # @!attribute [rw] start_time
  #   @return [::Google::Protobuf::Timestamp]
  #     Start time of a break.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of a break.
  class Break
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Deprecated: Use
  # {::Google::Cloud::Optimization::V1::ShipmentRoute::Transition ShipmentRoute.Transition}
  # instead. Travel between each visit along the route: from the vehicle's
  # `start_location` to the first visit's `arrival_location`, then from the
  # first visit's `departure_location` to the second visit's
  # `arrival_location`, and so on until the vehicle's `end_location`. This
  # accounts only for the actual travel between visits, not counting the
  # waiting time, the time spent performing a visit, nor the distance covered
  # during a visit.
  #
  # Invariant: `travel_steps_size() == visits_size() + 1`.
  #
  # If the vehicle does not have a start_ and/or end_location, the
  # corresponding travel metrics are 0 and/or empty.
  # @deprecated This message is deprecated and may be removed in the next major version update.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     Duration of the travel step.
  # @!attribute [rw] distance_meters
  #   @return [::Float]
  #     Distance traveled during the step.
  # @!attribute [rw] traffic_info_unavailable
  #   @return [::Boolean]
  #     When traffic is requested via
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic OptimizeToursRequest.consider_road_traffic},
  #     and the traffic info couldn't be retrieved for a TravelStep, this boolean
  #     is set to true. This may be temporary (rare hiccup in the realtime
  #     traffic servers) or permanent (no data for this location).
  # @!attribute [rw] route_polyline
  #   @return [::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline]
  #     The encoded polyline representation of the route followed during the
  #     step.
  #
  #     This field is only populated if
  #     {::Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines OptimizeToursRequest.populate_travel_step_polylines}
  #     is set to true.
  class TravelStep
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::Float]
  class RouteCostsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end