# Google Maps Route Optimization V1 Client - Class TransitionAttributes (0.6.2)

0.6.2 (latest) 0.6.1 0.5.1 0.4.1 0.3.3 0.2.0 0.1.0 Reference documentation and code samples for the Google Maps Route Optimization V1 Client class TransitionAttributes.

Specifies attributes of transitions between two consecutive visits on a
route. Several `TransitionAttributes` may apply to the same transition: in
that case, all extra costs add up and the strictest constraint or limit
applies (following natural "AND" semantics).

Generated from protobuf message `google.maps.routeoptimization.v1.TransitionAttributes`

## Namespace

Google \\ Maps \\ RouteOptimization \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ src_tag` | `string` Tags defining the set of (src-\>dst) transitions these attributes apply to. A source visit or vehicle start matches iff its [VisitRequest.tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment.VisitRequest#_Google_Maps_RouteOptimization_V1_Shipment_VisitRequest__getTags__) or [Vehicle.start_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getStartTags__) either contains `src_tag` or does not contain `excluded_src_tag` (depending on which of these two fields is non-empty). |
| `↳ excluded_src_tag` | `string` See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be non-empty. |
| `↳ dst_tag` | `string` A destination visit or vehicle end matches iff its [VisitRequest.tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment.VisitRequest#_Google_Maps_RouteOptimization_V1_Shipment_VisitRequest__getTags__) or [Vehicle.end_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getEndTags__) either contains `dst_tag` or does not contain `excluded_dst_tag` (depending on which of these two fields is non-empty). |
| `↳ excluded_dst_tag` | `string` See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be non-empty. |
| `↳ cost` | `float` Specifies a cost for performing this transition. This is in the same unit as all other costs in the model and must not be negative. It is applied on top of all other existing costs. |
| `↳ cost_per_kilometer` | `float` Specifies a cost per kilometer applied to the distance traveled while performing this transition. It adds up to any [Vehicle.cost_per_kilometer](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getCostPerKilometer__) specified on vehicles. |
| `↳ distance_limit` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.DistanceLimit` Specifies a limit on the distance traveled while performing this transition. As of 2021/06, only soft limits are supported. |
| `↳ delay` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` Specifies a delay incurred when performing this transition. This delay always occurs *after* finishing the source visit and *before* starting the destination visit. |

### getSrcTag

Tags defining the set of (src-\>dst) transitions these attributes apply to.

A source visit or vehicle start matches iff its
[VisitRequest.tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment.VisitRequest#_Google_Maps_RouteOptimization_V1_Shipment_VisitRequest__getTags__)
or
[Vehicle.start_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getStartTags__)
either contains `src_tag` or does not contain `excluded_src_tag` (depending
on which of these two fields is non-empty).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSrcTag

Tags defining the set of (src-\>dst) transitions these attributes apply to.

A source visit or vehicle start matches iff its
[VisitRequest.tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment.VisitRequest#_Google_Maps_RouteOptimization_V1_Shipment_VisitRequest__getTags__)
or
[Vehicle.start_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getStartTags__)
either contains `src_tag` or does not contain `excluded_src_tag` (depending
on which of these two fields is non-empty).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getExcludedSrcTag

See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
non-empty.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setExcludedSrcTag

See `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be
non-empty.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDstTag

A destination visit or vehicle end matches iff its
[VisitRequest.tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment.VisitRequest#_Google_Maps_RouteOptimization_V1_Shipment_VisitRequest__getTags__)
or [Vehicle.end_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getEndTags__)
either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
on which of these two fields is non-empty).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDstTag

A destination visit or vehicle end matches iff its
[VisitRequest.tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Shipment.VisitRequest#_Google_Maps_RouteOptimization_V1_Shipment_VisitRequest__getTags__)
or [Vehicle.end_tags](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getEndTags__)
either contains `dst_tag` or does not contain `excluded_dst_tag` (depending
on which of these two fields is non-empty).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getExcludedDstTag

See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
non-empty.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setExcludedDstTag

See `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be
non-empty.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCost

Specifies a cost for performing this transition. This is in the same unit
as all other costs in the model and must not be negative. It is applied on
top of all other existing costs.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setCost

Specifies a cost for performing this transition. This is in the same unit
as all other costs in the model and must not be negative. It is applied on
top of all other existing costs.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCostPerKilometer

Specifies a cost per kilometer applied to the distance traveled while
performing this transition. It adds up to any
[Vehicle.cost_per_kilometer](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getCostPerKilometer__)
specified on vehicles.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### setCostPerKilometer

Specifies a cost per kilometer applied to the distance traveled while
performing this transition. It adds up to any
[Vehicle.cost_per_kilometer](https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.Vehicle#_Google_Maps_RouteOptimization_V1_Vehicle__getCostPerKilometer__)
specified on vehicles.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDistanceLimit

Specifies a limit on the distance traveled while performing this
transition.

As of 2021/06, only soft limits are supported.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.DistanceLimit|null` |   |

### hasDistanceLimit

### clearDistanceLimit

### setDistanceLimit

Specifies a limit on the distance traveled while performing this
transition.

As of 2021/06, only soft limits are supported.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/maps-routeoptimization/latest/V1.DistanceLimit` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDelay

Specifies a delay incurred when performing this transition.

This delay always occurs *after* finishing the source visit and *before*
starting the destination visit.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration|null` |   |

### hasDelay

### clearDelay

### setDelay

Specifies a delay incurred when performing this transition.

This delay always occurs *after* finishing the source visit and *before*
starting the destination visit.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |