# Cloud Optimization v1 API - Class TransitionAttributes (2.7.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.7.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.6.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.5.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.4.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.3.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.2.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.1.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/2.0.0/Google.Cloud.Optimization.V1.TransitionAttributes)
- [1.0.0-beta01](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/1.0.0-beta01/Google.Cloud.Optimization.V1.TransitionAttributes)

    public sealed class TransitionAttributes : IMessage<TransitionAttributes>, IEquatable<TransitionAttributes>, IDeepCloneable<TransitionAttributes>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Optimization v1 API 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).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> TransitionAttributes

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TransitionAttributes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.TransitionAttributes), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TransitionAttributes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.TransitionAttributes), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TransitionAttributes](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.TransitionAttributes), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Optimization.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1)

## Assembly

Google.Cloud.Optimization.V1.dll

## Constructors

### TransitionAttributes()

    public TransitionAttributes()

### TransitionAttributes(TransitionAttributes)

    public TransitionAttributes(TransitionAttributes other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.TransitionAttributes` |

## Properties

### Cost

    public double Cost { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.double` |   |

### CostPerKilometer

    public double CostPerKilometer { get; set; }

Specifies a cost per kilometer applied to the distance traveled while
performing this transition. It adds up to any
\[Vehicle.cost_per_kilometer\]\[google.cloud.optimization.v1.Vehicle.cost_per_kilometer\]
specified on vehicles.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.double` |   |

### Delay

    public Duration Delay { get; set; }

Specifies a delay incurred when performing this transition.

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Duration.html` |   |

### DistanceLimit

    public DistanceLimit DistanceLimit { get; set; }

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

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.DistanceLimit` |   |

### DstTag

    public string DstTag { get; set; }

A destination visit or vehicle end matches iff its
\[VisitRequest.tags\]\[google.cloud.optimization.v1.Shipment.VisitRequest.tags\]
or \[Vehicle.end_tags\]\[google.cloud.optimization.v1.Vehicle.end_tags\] either
contains `dst_tag` or does not contain `excluded_dst_tag` (depending on
which of these two fields is non-empty).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ExcludedDstTag

    public string ExcludedDstTag { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ExcludedSrcTag

    public string ExcludedSrcTag { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### SrcTag

    public string SrcTag { get; set; }

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

A source visit or vehicle start matches iff its
\[VisitRequest.tags\]\[google.cloud.optimization.v1.Shipment.VisitRequest.tags\]
or \[Vehicle.start_tags\]\[google.cloud.optimization.v1.Vehicle.start_tags\]
either contains `src_tag` or does not contain `excluded_src_tag` (depending
on which of these two fields is non-empty).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |