Google Cloud Optimization V1 Client - Class TravelStep (0.2.0)

Reference documentation and code samples for the Google Cloud Optimization V1 Client class TravelStep.

Deprecated: Use 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.

Generated from protobuf message google.cloud.optimization.v1.ShipmentRoute.TravelStep

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ duration Google\Protobuf\Duration

Duration of the travel step.

↳ distance_meters float

Distance traveled during the step.

↳ traffic_info_unavailable bool

When traffic is requested via 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).

↳ route_polyline Google\Cloud\Optimization\V1\ShipmentRoute\EncodedPolyline

The encoded polyline representation of the route followed during the step. This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

getDuration

Duration of the travel step.

Returns
TypeDescription
Google\Protobuf\Duration|null

hasDuration

clearDuration

setDuration

Duration of the travel step.

Parameter
NameDescription
var Google\Protobuf\Duration
Returns
TypeDescription
$this

getDistanceMeters

Distance traveled during the step.

Returns
TypeDescription
float

setDistanceMeters

Distance traveled during the step.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getTrafficInfoUnavailable

When traffic is requested via 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).

Returns
TypeDescription
bool

setTrafficInfoUnavailable

When traffic is requested via 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).

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getRoutePolyline

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

Returns
TypeDescription
Google\Cloud\Optimization\V1\ShipmentRoute\EncodedPolyline|null

hasRoutePolyline

clearRoutePolyline

setRoutePolyline

The encoded polyline representation of the route followed during the step.

This field is only populated if OptimizeToursRequest.populate_travel_step_polylines is set to true.

Parameter
NameDescription
var Google\Cloud\Optimization\V1\ShipmentRoute\EncodedPolyline
Returns
TypeDescription
$this