Reference documentation and code samples for the Google Cloud Optimization V1 Client class TransitionAttributes.
Specifies attributes of transitions between two consecutive visits on a
route. SeveralTransitionAttributesmay 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 messagegoogle.cloud.optimization.v1.TransitionAttributes
Namespace
Google \ Cloud \ Optimization \ 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 itsVisitRequest.tagsorVehicle.start_tagseither containssrc_tagor does not containexcluded_src_tag(depending on which of these two fields is non-empty).
↳ excluded_src_tag
string
Seesrc_tag. Exactly one ofsrc_tagandexcluded_src_tagmust be non-empty.
↳ dst_tag
string
A destination visit or vehicle end matches iff itsVisitRequest.tagsorVehicle.end_tagseither containsdst_tagor does not containexcluded_dst_tag(depending on which of these two fields is non-empty).
↳ excluded_dst_tag
string
Seedst_tag. Exactly one ofdst_tagandexcluded_dst_tagmust 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 anyVehicle.cost_per_kilometerspecified on vehicles.
Specifies a delay incurred when performing this transition. This delay always occursafterfinishing the source visit andbeforestarting the destination visit.
getSrcTag
Tags defining the set of (src->dst) transitions these attributes apply to.
A source visit or vehicle start matches iff itsVisitRequest.tagsorVehicle.start_tagseither containssrc_tagor does not containexcluded_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 itsVisitRequest.tagsorVehicle.start_tagseither containssrc_tagor does not containexcluded_src_tag(depending
on which of these two fields is non-empty).
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getExcludedSrcTag
Seesrc_tag. Exactly one ofsrc_tagandexcluded_src_tagmust be
non-empty.
Returns
Type
Description
string
setExcludedSrcTag
Seesrc_tag. Exactly one ofsrc_tagandexcluded_src_tagmust be
non-empty.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getDstTag
A destination visit or vehicle end matches iff itsVisitRequest.tagsorVehicle.end_tagseither
containsdst_tagor does not containexcluded_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 itsVisitRequest.tagsorVehicle.end_tagseither
containsdst_tagor does not containexcluded_dst_tag(depending on
which of these two fields is non-empty).
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getExcludedDstTag
Seedst_tag. Exactly one ofdst_tagandexcluded_dst_tagmust be
non-empty.
Returns
Type
Description
string
setExcludedDstTag
Seedst_tag. Exactly one ofdst_tagandexcluded_dst_tagmust 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 anyVehicle.cost_per_kilometerspecified 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 anyVehicle.cost_per_kilometerspecified on vehicles.
Parameter
Name
Description
var
float
Returns
Type
Description
$this
getDistanceLimit
Specifies a limit on the distance traveled while performing this
transition.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Optimization V1 Client - Class TransitionAttributes (1.0.5)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.5 (latest)](/php/docs/reference/cloud-optimization/latest/V1.TransitionAttributes)\n- [1.0.4](/php/docs/reference/cloud-optimization/1.0.4/V1.TransitionAttributes)\n- [0.7.0](/php/docs/reference/cloud-optimization/0.7.0/V1.TransitionAttributes)\n- [0.6.5](/php/docs/reference/cloud-optimization/0.6.5/V1.TransitionAttributes)\n- [0.5.1](/php/docs/reference/cloud-optimization/0.5.1/V1.TransitionAttributes)\n- [0.4.0](/php/docs/reference/cloud-optimization/0.4.0/V1.TransitionAttributes)\n- [0.3.4](/php/docs/reference/cloud-optimization/0.3.4/V1.TransitionAttributes)\n- [0.2.0](/php/docs/reference/cloud-optimization/0.2.0/V1.TransitionAttributes)\n- [0.1.9](/php/docs/reference/cloud-optimization/0.1.9/V1.TransitionAttributes) \nReference documentation and code samples for the Google Cloud Optimization V1 Client class TransitionAttributes.\n\nSpecifies attributes of transitions between two consecutive visits on a\nroute. Several `TransitionAttributes` may apply to the same transition: in\nthat case, all extra costs add up and the strictest constraint or limit\napplies (following natural \"AND\" semantics).\n\nGenerated from protobuf message `google.cloud.optimization.v1.TransitionAttributes`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Optimization \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSrcTag\n\nTags defining the set of (src-\\\u003edst) transitions these attributes apply to.\n\nA source visit or vehicle start matches iff its\n[VisitRequest.tags](/php/docs/reference/cloud-optimization/latest/V1.Shipment.VisitRequest#_Google_Cloud_Optimization_V1_Shipment_VisitRequest__getTags__)\nor [Vehicle.start_tags](/php/docs/reference/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getStartTags__)\neither contains `src_tag` or does not contain `excluded_src_tag` (depending\non which of these two fields is non-empty).\n\n### setSrcTag\n\nTags defining the set of (src-\\\u003edst) transitions these attributes apply to.\n\nA source visit or vehicle start matches iff its\n[VisitRequest.tags](/php/docs/reference/cloud-optimization/latest/V1.Shipment.VisitRequest#_Google_Cloud_Optimization_V1_Shipment_VisitRequest__getTags__)\nor [Vehicle.start_tags](/php/docs/reference/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getStartTags__)\neither contains `src_tag` or does not contain `excluded_src_tag` (depending\non which of these two fields is non-empty).\n\n### getExcludedSrcTag\n\nSee `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be\nnon-empty.\n\n### setExcludedSrcTag\n\nSee `src_tag`. Exactly one of `src_tag` and `excluded_src_tag` must be\nnon-empty.\n\n### getDstTag\n\nA destination visit or vehicle end matches iff its\n[VisitRequest.tags](/php/docs/reference/cloud-optimization/latest/V1.Shipment.VisitRequest#_Google_Cloud_Optimization_V1_Shipment_VisitRequest__getTags__)\nor [Vehicle.end_tags](/php/docs/reference/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getEndTags__) either\ncontains `dst_tag` or does not contain `excluded_dst_tag` (depending on\nwhich of these two fields is non-empty).\n\n### setDstTag\n\nA destination visit or vehicle end matches iff its\n[VisitRequest.tags](/php/docs/reference/cloud-optimization/latest/V1.Shipment.VisitRequest#_Google_Cloud_Optimization_V1_Shipment_VisitRequest__getTags__)\nor [Vehicle.end_tags](/php/docs/reference/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getEndTags__) either\ncontains `dst_tag` or does not contain `excluded_dst_tag` (depending on\nwhich of these two fields is non-empty).\n\n### getExcludedDstTag\n\nSee `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be\nnon-empty.\n\n### setExcludedDstTag\n\nSee `dst_tag`. Exactly one of `dst_tag` and `excluded_dst_tag` must be\nnon-empty.\n\n### getCost\n\nSpecifies a cost for performing this transition. This is in the same unit\nas all other costs in the model and must not be negative. It is applied on\ntop of all other existing costs.\n\n### setCost\n\nSpecifies a cost for performing this transition. This is in the same unit\nas all other costs in the model and must not be negative. It is applied on\ntop of all other existing costs.\n\n### getCostPerKilometer\n\nSpecifies a cost per kilometer applied to the distance traveled while\nperforming this transition. It adds up to any\n[Vehicle.cost_per_kilometer](/php/docs/reference/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getCostPerKilometer__)\nspecified on vehicles.\n\n### setCostPerKilometer\n\nSpecifies a cost per kilometer applied to the distance traveled while\nperforming this transition. It adds up to any\n[Vehicle.cost_per_kilometer](/php/docs/reference/cloud-optimization/latest/V1.Vehicle#_Google_Cloud_Optimization_V1_Vehicle__getCostPerKilometer__)\nspecified on vehicles.\n\n### getDistanceLimit\n\nSpecifies a limit on the distance traveled while performing this\ntransition.\n\nAs of 2021/06, only soft limits are supported.\n\n### hasDistanceLimit\n\n### clearDistanceLimit\n\n### setDistanceLimit\n\nSpecifies a limit on the distance traveled while performing this\ntransition.\n\nAs of 2021/06, only soft limits are supported.\n\n### getDelay\n\nSpecifies a delay incurred when performing this transition.\n\nThis delay always occurs *after* finishing the source visit and *before*\nstarting the destination visit.\n\n### hasDelay\n\n### clearDelay\n\n### setDelay\n\nSpecifies a delay incurred when performing this transition.\n\nThis delay always occurs *after* finishing the source visit and *before*\nstarting the destination visit."]]