فهرست
-
RouteOptimization(رابط) -
AggregatedMetrics(پیام) -
BatchOptimizeToursMetadata(پیام) -
BatchOptimizeToursRequest(پیام) -
BatchOptimizeToursRequest.AsyncModelConfig(پیام) -
BatchOptimizeToursResponse(پیام) -
BreakRule(پیام) -
BreakRule.BreakRequest(پیام) -
BreakRule.FrequencyConstraint(پیام) -
DataFormat(شمارشی) -
DistanceLimit(پیام) -
GcsDestination(پیام) -
GcsSource(پیام) -
InjectedSolutionConstraint(پیام) -
InjectedSolutionConstraint.ConstraintRelaxation(پیام) -
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation(پیام) -
InjectedSolutionConstraint.ConstraintRelaxation.Relaxation.Level(شمارشی) -
InputConfig(پیام) -
Location(پیام) -
OptimizeToursLongRunningMetadata(پیام) -
OptimizeToursRequest(پیام) -
OptimizeToursRequest.SearchMode(شمارشی) -
OptimizeToursRequest.SolvingMode(شمارشی) -
OptimizeToursResponse(پیام) -
OptimizeToursResponse.Metrics(پیام) -
OptimizeToursUriMetadata(پیام) -
OptimizeToursUriRequest(پیام) -
OptimizeToursUriResponse(پیام) -
OptimizeToursValidationError(پیام) -
OptimizeToursValidationError.FieldReference(پیام) -
OutputConfig(پیام) -
RouteModifiers(پیام) -
Shipment(پیام) -
Shipment.Load(پیام) -
Shipment.VisitRequest(پیام) -
ShipmentModel(پیام) -
ShipmentModel.DurationDistanceMatrix(پیام) -
ShipmentModel.DurationDistanceMatrix.Row(پیام) -
ShipmentModel.Objective(پیام) -
ShipmentModel.Objective.Typeنوع (شمارشی) -
ShipmentModel.PrecedenceRule(پیام) -
ShipmentRoute(پیام) -
ShipmentRoute.Break(پیام) -
ShipmentRoute.EncodedPolyline(پیام) -
ShipmentRoute.Transition(پیام) -
ShipmentRoute.VehicleLoad(پیام) -
ShipmentRoute.Visit(پیام) -
ShipmentTypeIncompatibility(پیام) -
ShipmentTypeIncompatibility.IncompatibilityModeناسازگاری (شمارشی) -
ShipmentTypeRequirement(پیام) -
ShipmentTypeRequirement.RequirementMode(شمارشی) -
SkippedShipment(پیام) -
SkippedShipment.Reason(پیام) -
SkippedShipment.Reason.Code(enum) -
TimeWindow(پیام) -
TransitionAttributes(پیام) -
Uri(پیام) -
Vehicle(پیام) -
Vehicle.DurationLimit(پیام) -
Vehicle.LoadLimit(پیام) -
Vehicle.LoadLimit.Interval(پیام) -
Vehicle.LoadLimit.LoadCost(پیام) -
Vehicle.TravelMode(شمارشی) -
Vehicle.UnloadingPolicy(شمارشی) -
VehicleFullness(پیام) -
Waypoint(پیام)
بهینهسازی مسیر
سرویسی برای بهینهسازی تورهای خودرویی.
اعتبار انواع خاصی از فیلدها:
-
google.protobuf.Timestamp- زمانها به صورت یونیکس هستند: ثانیه از تاریخ 1970-01-01T00:00:00+00:00.
- ثانیه باید در [0, 253402300799] باشد، یعنی در [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
- نانوها باید غیرفعال یا روی ۰ تنظیم شوند.
-
google.protobuf.Duration- ثانیه باید در [0, 253402300799] باشد، یعنی در [1970-01-01T00:00:00+00:00, 9999-12-31T23:59:59+00:00].
- نانوها باید غیرفعال یا روی ۰ تنظیم شوند.
-
google.type.LatLng- عرض جغرافیایی باید در بازه [-90.0, 90.0] باشد.
- طول جغرافیایی باید در محدوده [-180.0, 180.0] باشد.
- حداقل یکی از طول و عرض جغرافیایی باید غیر صفر باشد.
| تورهای بهینه سازی دسته ای |
|---|
تورهای خودرو را برای یک یا چند پیام این روش یک عملیات طولانی مدت (LRO) است. ورودیهای بهینهسازی (پیامهای کاربر میتواند برای بررسی وضعیت LRO از اگر فیلد اگر فیلد
|
| بهینه سازی تورها |
|---|
یک یک مدل هدف، ارائه تخصیصی از
|
| OptimizeToursLongRunning |
|---|
این نوعی از روش آزمایشی: برای جزئیات بیشتر به https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request مراجعه کنید.
|
| OptimizeToursUri |
|---|
این نوعی از روش کلاینت، URI مربوط به این روش باید نسبت به روش آزمایشی: برای جزئیات بیشتر به https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request مراجعه کنید.
|
معیارهای تجمیعشده
معیارهای تجمیعشده برای ShipmentRoute (بهعنوان مثال OptimizeToursResponse روی تمام عناصر Transition و/یا Visit (بهعنوان مثال ShipmentRoute )
| فیلدها | |
|---|---|
performed_shipment_count | تعداد ارسالهای انجام شده. توجه داشته باشید که یک جفت دریافت و تحویل فقط یک بار حساب میشود. |
travel_duration | کل مدت زمان سفر برای یک مسیر یا یک راه حل. |
wait_duration | کل مدت زمان انتظار برای یک مسیر یا یک راه حل. |
delay_duration | کل مدت تأخیر برای یک مسیر یا یک راهحل. |
break_duration | کل مدت زمان استراحت برای یک مسیر یا یک راه حل. |
visit_duration | کل مدت زمان بازدید برای یک مسیر یا یک راه حل. |
total_duration | کل مدت زمان باید برابر با مجموع تمام مدت زمانهای بالا باشد. برای مسیرها، این مقدار همچنین معادل است با: |
travel_distance_meters | کل مسافت طی شده برای یک مسیر یا یک راه حل. |
max_loads | حداکثر بار حاصل شده در کل مسیر (به جای راه حل)، برای هر یک از مقادیر موجود در این مسیر (به جای راه حل)، که به عنوان حداکثر بار در تمام |
performed_mandatory_shipment_count | تعداد محمولههای اجباری انجام شده. تجربی: رفتار یا وجود این میدان ممکن است در آینده تغییر کند. |
performed_shipment_penalty_cost_sum | مجموع تجربی: رفتار یا وجود این میدان ممکن است در آینده تغییر کند. |
فرادادههای BatchOptimizeTours
این نوع هیچ فیلدی ندارد.
فرادادههای عملیاتی برای فراخوانیهای BatchOptimizeToursRequest .
درخواست دستهای بهینهسازی تورها
درخواست برای بهینهسازی دستهای تورها به عنوان یک عملیات ناهمزمان. هر فایل ورودی باید شامل یک OptimizeToursRequest و هر فایل خروجی شامل یک OptimizeToursResponse باشد. این درخواست شامل اطلاعاتی برای خواندن/نوشتن و تجزیه فایلها است. همه فایلهای ورودی و خروجی باید تحت یک پروژه واحد باشند.
| فیلدها | |
|---|---|
parent | الزامی. پروژه و مکان مورد نظر برای برقراری تماس. قالب:
اگر هیچ مکانی مشخص نشده باشد، یک منطقه به طور خودکار انتخاب میشود. |
model_configs[] | الزامی. اطلاعات ورودی/خروجی برای هر مدل خرید، مانند مسیر فایلها و فرمتهای داده. |
پیکربندی AsyncModel
اطلاعات برای حل یک مدل بهینهسازی به صورت غیرهمزمان.
| فیلدها | |
|---|---|
display_name | اختیاری. نام مدل تعریفشده توسط کاربر، میتواند به عنوان نام مستعار توسط کاربران برای پیگیری مدلها استفاده شود. |
input_config | الزامی. اطلاعات مربوط به مدل ورودی. |
output_config | الزامی. اطلاعات محل خروجی مورد نظر. |
پاسخ دستهای بهینهسازی تورها
این نوع هیچ فیلدی ندارد.
پاسخ به درخواست BatchOptimizeToursRequest . این درخواست پس از تکمیل عملیات در Long Running Operation بازگردانده میشود.
شکستن قانون
قوانینی برای ایجاد زمان استراحت برای وسیله نقلیه (مثلاً زمان ناهار). استراحت یک دوره زمانی پیوسته است که طی آن وسیله نقلیه در موقعیت فعلی خود بیکار میماند و نمیتواند هیچ بازدیدی انجام دهد. استراحت ممکن است رخ دهد:
- در طول سفر بین دو بازدید (که شامل زمان درست قبل یا درست بعد از یک بازدید میشود، اما نه در وسط یک بازدید)، که در این صورت زمان حمل و نقل مربوطه بین بازدیدها را افزایش میدهد،
- یا قبل از روشن شدن خودرو (ممکن است خودرو در وسط استراحت روشن نشود)، که در این صورت تاثیری بر زمان روشن شدن خودرو ندارد.
- یا بعد از پایان وسیله نقلیه (به همین ترتیب، با زمان پایان وسیله نقلیه).
| فیلدها | |
|---|---|
break_requests[] | توالی وقفهها. به پیام |
frequency_constraints[] | چندین |
درخواست وقفه
توالی وقفهها (یعنی تعداد و ترتیب آنها) که برای هر وسیله نقلیه اعمال میشود، باید از قبل مشخص باشد. درخواستهای مکرر BreakRequest آن توالی را به ترتیبی که باید رخ دهند، تعریف میکنند. پنجرههای زمانی آنها ( earliest_start_time / latest_start_time ) ممکن است با هم همپوشانی داشته باشند، اما باید با ترتیب آنها سازگار باشند (این مورد بررسی شده است).
| فیلدها | |
|---|---|
earliest_start_time | الزامی. حد پایین (شامل) در شروع استراحت. |
latest_start_time | الزامی. حد بالا (شامل) در شروع استراحت. |
min_duration | الزامی. حداقل مدت زمان استراحت. باید مثبت باشد. |
محدودیت فرکانس
میتوان با اعمال حداقل فرکانس وقفه، مانند «باید هر ۱۲ ساعت حداقل ۱ ساعت وقفه وجود داشته باشد»، فرکانس و مدت زمان وقفههای مشخص شده در بالا را بیشتر محدود کرد. با فرض اینکه این عبارت را بتوان به صورت «در هر پنجره زمانی متغیر ۱۲ ساعته، باید حداقل یک وقفه حداقل یک ساعته وجود داشته باشد» تفسیر کرد، این مثال به FrequencyConstraint زیر تبدیل میشود:
{
min_break_duration { seconds: 3600 } # 1 hour.
max_inter_break_duration { seconds: 39600 } # 11 hours (12 - 1 = 11).
}
زمانبندی و مدت زمان وقفهها در راهحل، علاوه بر پنجرههای زمانی و حداقل مدت زمانهای مشخصشده در BreakRequest ، تمام این محدودیتها را نیز در نظر خواهد گرفت.
یک FrequencyConstraint ممکن است در عمل برای وقفههای غیر متوالی اعمال شود. برای مثال، برنامه زیر مثال "1 ساعت هر 12 ساعت" را رعایت میکند:
04:00 vehicle start
.. performing travel and visits ..
09:00 1 hour break
10:00 end of the break
.. performing travel and visits ..
12:00 20-min lunch break
12:20 end of the break
.. performing travel and visits ..
21:00 1 hour break
22:00 end of the break
.. performing travel and visits ..
23:59 vehicle end
| فیلدها | |
|---|---|
min_break_duration | الزامی. حداقل مدت زمان وقفه برای این محدودیت. غیرمنفی. به توضیحات |
max_inter_break_duration | الزامی. حداکثر طول مجاز هر بازه زمانی در مسیر که حداقل بخشی از آن شامل یک وقفه با |
قالب داده
قالبهای داده برای فایلهای ورودی و خروجی
| انومها | |
|---|---|
DATA_FORMAT_UNSPECIFIED | مقدار نامعتبر است، فرمت نباید نامشخص باشد. |
JSON | نمادگذاری شیء جاوا اسکریپت |
PROTO_TEXT | قالب متنی Protocol Buffers. به https://protobuf.dev/reference/protobuf/textformat-spec/ مراجعه کنید. |
محدودیت فاصله
محدودیتی که حداکثر مسافت قابل پیمایش را تعیین میکند. این محدودیت میتواند سخت یا نرم باشد.
اگر یک حد نرم تعریف شود، هر دو soft_max_meters و cost_per_kilometer_above_soft_max باید تعریف شده و غیرمنفی باشند.
| فیلدها | |
|---|---|
max_meters | یک حد مشخص که فاصله را حداکثر به max_meters محدود میکند. این حد باید غیرمنفی باشد. |
soft_max_meters | یک محدودیت نرم که محدودیت حداکثر فاصله را اعمال نمیکند، اما در صورت نقض، منجر به هزینهای میشود که با سایر هزینههای تعریف شده در مدل، با همان واحد، جمع میشود. اگر soft_max_meters تعریف شده باشد، باید کمتر از max_meters باشد و باید غیرمنفی باشد. |
cost_per_kilometer_below_soft_max | هزینه به ازای هر کیلومتر متحمل شده، که تا این هزینه در |
cost_per_kilometer_above_soft_max | هزینه به ازای هر کیلومتر در صورتی که مسافت بیشتر از حد مجاز هزینه باید غیرمنفی باشد. |
مقصد Gcs
محل ذخیرهسازی ابری گوگل که فایل(های) خروجی در آن نوشته خواهند شد.
| فیلدها | |
|---|---|
uri | الزامی. آدرس اینترنتی فضای ذخیرهسازی ابری گوگل. |
جی سی اس سورس
محل ذخیرهسازی ابری گوگل که فایل ورودی از آنجا خوانده خواهد شد.
| فیلدها | |
|---|---|
uri | الزامی. آدرس اینترنتی (URI) یک شیء ذخیرهسازی ابری گوگل با فرمت |
محدودیت راهحل تزریقشده
راهکار تزریقشده در درخواست، شامل اطلاعاتی در مورد اینکه کدام بازدیدها باید محدود شوند و نحوهی محدود کردن آنها.
| فیلدها | |
|---|---|
routes[] | مسیرهای راه حل برای تزریق. برخی از مسیرها ممکن است از راه حل اصلی حذف شوند. مسیرها و محمولههای از قلم افتاده باید فرضیات اعتبار اساسی ذکر شده برای |
skipped_shipments[] | محمولههای محلول برای تزریق نادیده گرفته شدهاند. برخی ممکن است از محلول اصلی حذف شده باشند. به فیلد |
constraint_relaxations[] | برای صفر یا چند گروه از وسایل نقلیه، مشخص میکند که چه زمانی و چقدر محدودیتها را کاهش دهید. اگر این فیلد خالی باشد، تمام مسیرهای وسایل نقلیه غیر خالی کاملاً محدود میشوند. |
محدودیت-آرامش
برای گروهی از وسایل نقلیه، مشخص میکند که در چه آستانه(هایی) محدودیتهای بازدیدها برداشته میشوند و در چه سطحی. محمولههای فهرستشده در فیلد skipped_shipment محدود به رد شدن هستند؛ یعنی نمیتوان آنها را انجام داد.
| فیلدها | |
|---|---|
relaxations[] | تمام محدودیتهای بازدید که برای بازدیدهای مسیرهایی با وسایل نقلیه در |
vehicle_indices[] | شاخصهای وسیله نقلیهای را مشخص میکند که اگر |
آرامش
اگر relaxations خالی باشد، زمان شروع و توالی تمام بازدیدها در routes کاملاً محدود شده و هیچ بازدید جدیدی نمیتواند به آن مسیرها اضافه یا ثبت شود. همچنین، زمان شروع و پایان یک وسیله نقلیه در routes کاملاً محدود شده است، مگر اینکه وسیله نقلیه خالی باشد (یعنی هیچ بازدیدی نداشته باشد و used_if_route_is_empty در مدل روی false تنظیم شده باشد).
relaxations(i).level سطح آزادسازی محدودیت اعمال شده بر روی بازدید #j را که شرایط زیر را برآورده میکند، مشخص میکند:
-
route.visits(j).start_time >= relaxations(i).threshold_timeAND -
j + 1 >= relaxations(i).threshold_visit_count
به طور مشابه، اگر شرایط زیر را برآورده کند، استارت خودرو تا relaxations(i).level آرام میشود:
-
vehicle_start_time >= relaxations(i).threshold_timeو -
relaxations(i).threshold_visit_count == 0و انتهای وسیله نقلیه در صورت برآورده شدن موارد زیر، بهrelaxations(i).levelکاهش مییابد: -
vehicle_end_time >= relaxations(i).threshold_timeAND -
route.visits_size() + 1 >= relaxations(i).threshold_visit_count
برای اعمال سطح آرامش در صورتی که یک بازدید به threshold_visit_count یا threshold_time برسد، دو relaxations با همان level را اضافه کنید: یکی فقط با مجموعه threshold_visit_count و دیگری فقط با مجموعه threshold_time . اگر یک بازدید شرایط چندین relaxations برآورده کند، سطح آرامش بیشتر اعمال میشود. در نتیجه، از شروع وسیله نقلیه تا بازدیدهای مسیر به سمت انتهای وسیله نقلیه، سطح آرامش آرامتر میشود: یعنی سطح آرامش با پیشرفت مسیر کاهش نمییابد.
زمانبندی و توالی بازدیدهای مسیری که شرایط آستانه هیچ گونه relaxations برآورده نمیکنند، کاملاً محدود شدهاند و هیچ بازدیدی نمیتواند در این توالیها قرار گیرد. همچنین، اگر شروع یا پایان وسیله نقلیه شرایط هیچ گونه تسهیلی را برآورده نکند، زمان ثابت است، مگر اینکه وسیله نقلیه خالی باشد.
| فیلدها | |
|---|---|
level | سطح آزادسازی محدودیت که زمانی اعمال میشود که شرایط در |
threshold_time | زمانی که در آن یا پس از آن میتوان |
threshold_visit_count | تعداد بازدیدهایی که در زمان یا پس از آن اگر |
سطح
سطوح مختلف آزادسازی قید را بیان میکند، که برای یک بازدید اعمال میشوند و مواردی که پس از برآورده شدن شرایط آستانه اعمال میشوند.
فهرست زیر به ترتیب افزایش آرامش است.
| انومها | |
|---|---|
LEVEL_UNSPECIFIED | سطح پیشفرض ضمنیِ آزادسازی: هیچ قیدی آزاد نمیشود، یعنی همه بازدیدها کاملاً محدود شدهاند. این مقدار نباید به صراحت در |
RELAX_VISIT_TIMES_AFTER_THRESHOLD | زمان شروع بازدید و زمان شروع/پایان وسیله نقلیه کاهش مییابد، اما هر بازدید محدود به همان وسیله نقلیه باقی میماند و توالی بازدید باید رعایت شود: هیچ بازدیدی نمیتواند بین آنها یا قبل از آنها قرار گیرد. |
RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD | همانند RELAX_VISIT_TIMES_AFTER_THRESHOLD است، اما توالی بازدیدها نیز سادهتر شده است: بازدیدها فقط میتوانند توسط این وسیله نقلیه انجام شوند، اما میتوانند به طور بالقوه انجام نشوند. |
RELAX_ALL_AFTER_THRESHOLD | همانند RELAX_VISIT_TIMES_AND_SEQUENCE_AFTER_THRESHOLD است، اما وسیله نقلیه نیز آرام میشود: بازدیدها در زمان آستانه یا بعد از آن کاملاً رایگان هستند و میتوانند به طور بالقوه انجام نشوند. |
پیکربندی ورودی
یک ورودی برای [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours] مشخص کنید.
| فیلدها | |
|---|---|
data_format | الزامی. قالب داده ورودی. |
فیلد source ) الزامی است. source فقط میتواند یکی از موارد زیر باشد: | |
gcs_source | یک مکان ذخیرهسازی ابری گوگل. این مکان باید یک شیء (فایل) واحد باشد. |
مکان
یک مکان (یک نقطه جغرافیایی و یک عنوان اختیاری) را در بر میگیرد.
| فیلدها | |
|---|---|
lat_lng | مختصات جغرافیایی محل مورد نظر. |
heading | جهت قطبنما که با جهت جریان ترافیک مرتبط است. این مقدار برای مشخص کردن سمت جاده برای سوار و پیاده کردن استفاده میشود. مقادیر جهت میتوانند از ۰ تا ۳۶۰ باشند، که در آن ۰ جهت شمال، ۹۰ جهت شرق و غیره را مشخص میکند. |
OptimizeToursLongRunningفراداده
این نوع هیچ فیلدی ندارد.
فرادادههای عملیاتی برای فراخوانیهای OptimizeToursLongRunning .
درخواست تورهای بهینه سازی
درخواست داده شدن به یک حلکننده بهینهسازی تور که مدل حمل و نقل مورد نظر برای حل و همچنین پارامترهای بهینهسازی را تعریف میکند.
| فیلدها | |
|---|---|
parent | الزامی. پروژه یا مکان مورد نظر برای برقراری تماس. قالب:
اگر هیچ مکانی مشخص نشده باشد، یک منطقه به طور خودکار انتخاب میشود. |
timeout | اگر این مهلت زمانی تنظیم شود، سرور قبل از اتمام دوره مهلت زمانی یا رسیدن به مهلت سرور برای درخواستهای همزمان، هر کدام که زودتر باشد، پاسخی را برمیگرداند. برای درخواستهای ناهمزمان، سرور (در صورت امکان) قبل از اتمام مهلت زمانی، یک راهحل ایجاد میکند. |
model | مدل حمل و نقل برای حل. |
solving_mode | به طور پیشفرض، حالت حل |
search_mode | حالت جستجو برای حل درخواست استفاده میشود. |
injected_first_solution_routes[] | الگوریتم بهینهسازی را در یافتن اولین راهحلی که مشابه راهحل قبلی است، هدایت کنید. این مدل هنگام ساخت اولین راهحل، محدود میشود. هر محمولهای که در یک مسیر انجام نشود، به طور ضمنی در راهحل اول نادیده گرفته میشود، اما ممکن است در راهحلهای متوالی انجام شود. راه حل باید برخی از فرضیات اعتبار اساسی را برآورده کند:
اگر راهحل تزریقشده عملی نباشد، لزوماً خطای اعتبارسنجی برگردانده نمیشود و ممکن است به جای آن خطایی مبنی بر غیرممکن بودن برگردانده شود. |
injected_solution_constraint | الگوریتم بهینهسازی را محدود کنید تا یک راهحل نهایی پیدا کند که مشابه راهحل قبلی باشد. برای مثال، این میتواند برای ثابت کردن بخشهایی از مسیرها که قبلاً تکمیل شدهاند یا قرار است تکمیل شوند اما نباید اصلاح شوند، استفاده شود. اگر راهحل تزریقشده عملی نباشد، لزوماً خطای اعتبارسنجی برگردانده نمیشود و ممکن است به جای آن خطایی مبنی بر غیرممکن بودن برگردانده شود. |
refresh_details_routes[] | اگر خالی نباشد، مسیرهای داده شده بدون تغییر توالی بازدیدها یا زمانهای سفر مربوطه، بهروزرسانی میشوند: فقط سایر جزئیات بهروزرسانی میشوند. این کار مدل را حل نمیکند. از تاریخ ۲۰۲۰/۱۱، این فقط خطوط چندخطی مسیرهای غیرخالی را پر میکند و مستلزم آن است که فیلدهای این فیلد نباید همراه با |
interpret_injected_solutions_using_labels | اگر درست باشد:
این تفسیر در مورد فیلدهای اگر درست باشد، برچسبهای موجود در دستههای زیر باید حداکثر یک بار در دسته خود ظاهر شوند:
اگر یک حذف بازدیدهای مسیر یا کل مسیرها از یک راهحل تزریقشده ممکن است بر محدودیتهای ضمنی تأثیر بگذارد، که ممکن است منجر به تغییر در راهحل، خطاهای اعتبارسنجی یا عدم امکانسنجی شود. نکته: فراخواننده باید اطمینان حاصل کند که هر |
consider_road_traffic | تخمین ترافیک را در محاسبه فیلدهای |
populate_polylines | اگر درست باشد، چندخطیها در |
populate_transition_polylines | اگر درست باشد، چندخطیها و توکنهای مسیر در پاسخ |
allow_large_deadline_despite_interruption_risk | اگر این تنظیم شده باشد، درخواست میتواند مهلتی (به https://grpc.io/blog/deadlines مراجعه کنید) تا ۶۰ دقیقه داشته باشد. در غیر این صورت، حداکثر مهلت فقط ۳۰ دقیقه است. توجه داشته باشید که درخواستهای طولانی مدت، خطر وقفه بسیار بیشتری (اما همچنان کم) دارند. |
use_geodesic_distances | اگر درست باشد، مسافتهای سفر به جای مسافتهای نقشههای گوگل، با استفاده از مسافتهای ژئودزیک محاسبه میشوند و زمانهای سفر با استفاده از مسافتهای ژئودزیک با سرعتی که توسط |
label | برچسبی که ممکن است برای شناسایی این درخواست استفاده شود، در |
geodesic_meters_per_second | وقتی |
max_validation_errors | تعداد خطاهای اعتبارسنجی برگشتی را کوتاه میکند. این خطاها معمولاً به عنوان جزئیات خطای BadRequest ( https://cloud.google.com/apis/design/errors#error_details ) به یک payload خطای INVALID_ARGUMENT پیوست میشوند، مگر اینکه solving_mode=VALIDATE_ONLY باشد: به فیلد |
حالت جستجو
حالتی که رفتار جستجو را تعریف میکند و تأخیر را در مقابل کیفیت راهحل متعادل میکند. در همه حالتها، مهلت درخواست سراسری اعمال میشود.
| انومها | |
|---|---|
SEARCH_MODE_UNSPECIFIED | حالت جستجوی نامشخص، معادل RETURN_FAST . |
RETURN_FAST | پس از یافتن اولین راه حل خوب، جستجو را متوقف کنید. |
CONSUME_ALL_AVAILABLE_TIME | تمام وقت موجود را صرف جستجوی راهحلهای بهتر کنید. |
حالت حل
نحوهی مدیریت درخواست توسط حلکننده را تعریف میکند. در تمام حالتها به جز VALIDATE_ONLY ، اگر درخواست نامعتبر باشد، خطای INVALID_REQUEST دریافت خواهید کرد. برای تعیین حداکثر تعداد خطاهای برگشتی، به max_validation_errors مراجعه کنید.
| انومها | |
|---|---|
DEFAULT_SOLVE | مدل را حل کنید. ممکن است هشدارهایی در [OptimizeToursResponse.validation_errors][google.cloud.optimization.v1.OptimizeToursResponse.validation_errors] صادر شود. |
VALIDATE_ONLY | فقط مدل را بدون حل آن اعتبارسنجی میکند: تا حد امکان OptimizeToursResponse.validation_errors پر میکند. |
DETECT_SOME_INFEASIBLE_SHIPMENTS | فقط مهم : همه محمولههای غیرقابل اجرا در اینجا بازگردانده نمیشوند، بلکه فقط آنهایی که در طول پیشپردازش غیرقابل اجرا تشخیص داده شدهاند، بازگردانده میشوند. |
TRANSFORM_AND_RETURN_REQUEST | این حالت فقط در صورتی کار میکند که آزمایشی: برای جزئیات بیشتر به https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request مراجعه کنید. |
OptimizeToursResponse
پاسخ پس از حل یک مسئله بهینهسازی تور شامل مسیرهایی که هر وسیله نقلیه طی میکند، محمولههایی که از آنها صرف نظر شده است و هزینه کلی راهحل.
| فیلدها | |
|---|---|
routes[] | مسیرهای محاسبهشده برای هر وسیله نقلیه؛ مسیر iام مربوط به iام وسیله نقلیه در مدل است. |
request_label | کپی از |
skipped_shipments[] | لیست تمام محمولهها از قلم افتاد. |
validation_errors[] | فهرست تمام خطاهای اعتبارسنجی که توانستیم بهطور مستقل تشخیص دهیم. برای پیام |
processed_request | در برخی موارد، ما درخواست ورودی را قبل از حل آن اصلاح میکنیم، یعنی هزینهها را اضافه میکنیم. اگر solving_mode == TRANSFORM_AND_RETURN_REQUEST باشد، درخواست اصلاحشده در اینجا بازگردانده میشود. آزمایشی: برای جزئیات بیشتر به https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request مراجعه کنید. |
metrics | معیارهای مدت زمان، مسافت و میزان استفاده برای این راهکار. |
معیارها
معیارهای کلی، که در تمام مسیرها تجمیع شدهاند.
| فیلدها | |
|---|---|
aggregated_route_metrics | روی مسیرها تجمیع شده است. هر معیار، مجموع (یا حداکثر، برای بارها) روی تمام فیلدهای |
skipped_mandatory_shipment_count | تعداد محمولههای اجباری که از آنها صرف نظر شده است. |
used_vehicle_count | تعداد وسایل نقلیه استفاده شده. توجه: اگر مسیر یک وسیله نقلیه خالی باشد و |
earliest_vehicle_start_time | زودترین زمان شروع برای یک وسیله نقلیه دست دوم، که به عنوان حداقل زمان برای همه وسایل نقلیه دست دوم |
latest_vehicle_end_time | دیرترین زمان پایان برای یک وسیله نقلیه دست دوم، که به عنوان حداکثر زمان برای همه وسایل نقلیه دست دوم |
costs | هزینه راهحل، تفکیکشده بر اساس فیلدهای درخواست مرتبط با هزینه. کلیدها مسیرهای اولیه، نسبت به ورودی OptimizeToursRequest هستند، مثلاً "model.shipments.pickups.cost"، و مقادیر، کل هزینه تولید شده توسط فیلد هزینه مربوطه هستند که در کل راهحل تجمیع شدهاند. به عبارت دیگر، costs["model.shipments.pickups.cost"] مجموع تمام هزینههای جمعآوری در راهحل است. تمام هزینههای تعریفشده در مدل در اینجا با جزئیات گزارش شدهاند، به استثنای هزینههای مربوط به TransitionAttributes که فقط از تاریخ 2022/01 به صورت تجمیعشده گزارش شدهاند. |
total_cost | هزینه کل راهحل. مجموع تمام مقادیر موجود در نقشه هزینهها. |
OptimizeToursUriفراداده
این نوع هیچ فیلدی ندارد.
فرادادههای عملیاتی برای فراخوانیهای OptimizeToursUri .
OptimizeToursUriدرخواست
درخواستی که توسط متد OptimizeToursUri استفاده میشود.
| فیلدها | |
|---|---|
parent | الزامی. پروژه یا مکان مورد نظر برای برقراری تماس. قالب:
اگر هیچ مکانی مشخص نشده باشد، یک منطقه به طور خودکار انتخاب میشود. |
input | الزامی. آدرس اینترنتی (URI) شیء Cloud Storage که شامل |
output | الزامی. آدرس اینترنتی (URI) شیء ذخیرهسازی ابری که شامل |
OptimizeToursUriResponse
پاسخی که توسط متد OptimizeToursUri برگردانده میشود.
| فیلدها | |
|---|---|
output | اختیاری. URI شیء Cloud Storage که حاوی میتوان از |
خطای اعتبارسنجی OptimizeTours
خطا یا هشداری را توصیف میکند که هنگام اعتبارسنجی یک OptimizeToursRequest با آن مواجه میشویم.
| فیلدها | |
|---|---|
code | یک خطای اعتبارسنجی توسط جفت ( فیلدهای بعد از این بخش، اطلاعات بیشتری در مورد خطا ارائه میدهند. MULTIPLE ERRORS : When there are multiple errors, the validation process tries to output several of them. Much like a compiler, this is an imperfect process. Some validation errors will be "fatal", meaning that they stop the entire validation process. This is the case for STABILITY : |
display_name | The error display name. |
fields[] | An error context may involve 0, 1 (most of the time) or more fields. For example, referring to vehicle #4 and shipment #2's first pickup can be done as follows: Note, however, that the cardinality of |
error_message | Human-readable string describing the error. There is a 1:1 mapping between STABILITY : Not stable: the error message associated to a given |
offending_values | May contain the value(s) of the field(s). This is not always available. You should absolutely not rely on it and use it only for manual model debugging. |
FieldReference
Specifies a context for the validation error. A FieldReference always refers to a given field in this file and follows the same hierarchical structure. For example, we may specify element #2 of start_time_windows of vehicle #5 using:
name: "vehicles" index: 5 sub_field { name: "end_time_windows" index: 2 }
We however omit top-level entities such as OptimizeToursRequest or ShipmentModel to avoid crowding the message.
| فیلدها | |
|---|---|
name | Name of the field, eg, "vehicles". |
sub_field | Recursively nested sub-field, if needed. |
Union field | |
index | Index of the field if repeated. |
key | Key if the field is a map. |
OutputConfig
Specify a destination for [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours] results.
| فیلدها | |
|---|---|
data_format | Required. The output data format. |
Union field destination . Required. destination can be only one of the following: | |
gcs_destination | The Google Cloud Storage location to write the output to. |
RouteModifiers
Encapsulates a set of optional conditions to satisfy when calculating vehicle routes. This is similar to RouteModifiers in the Google Maps Platform Routes Preferred API; see: https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteModifiers .
| فیلدها | |
|---|---|
avoid_tolls | Specifies whether to avoid toll roads where reasonable. Preference will be given to routes not containing toll roads. Applies only to motorized travel modes. |
avoid_highways | Specifies whether to avoid highways where reasonable. Preference will be given to routes not containing highways. Applies only to motorized travel modes. |
avoid_ferries | Specifies whether to avoid ferries where reasonable. Preference will be given to routes not containing travel by ferries. Applies only to motorized travel modes. |
avoid_indoor | Optional. Specifies whether to avoid navigating indoors where reasonable. Preference will be given to routes not containing indoor navigation. Applies only to the |
حمل و نقل
The shipment of a single item, from one of its pickups to one of its deliveries. For the shipment to be considered as performed, a unique vehicle must visit one of its pickup locations (and decrease its spare capacities accordingly), then visit one of its delivery locations later on (and therefore re-increase its spare capacities accordingly).
| فیلدها | |
|---|---|
display_name | The user-defined display name of the shipment. It can be up to 63 characters long and may use UTF-8 characters. |
pickups[] | Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries. |
deliveries[] | Set of delivery alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the pickups. |
load_demands | Load demands of the shipment (for example weight, volume, number of pallets etc). The keys in the map should be identifiers describing the type of the corresponding load, ideally also including the units. For example: "weight_kg", "volume_gallons", "pallet_count", etc. If a given key does not appear in the map, the corresponding load is considered as null. |
allowed_vehicle_indices[] | The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the |
costs_per_vehicle[] | Specifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:
These costs must be in the same unit as |
costs_per_vehicle_indices[] | Indices of the vehicles to which |
pickup_to_delivery_absolute_detour_limit | Specifies the maximum absolute detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles. |
pickup_to_delivery_time_limit | Specifies the maximum duration from start of pickup to start of delivery of a shipment. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. This does not depend on which alternatives are selected for pickup and delivery, nor on vehicle speed. This can be specified alongside maximum detour constraints: the solution will respect both specifications. |
shipment_type | Non-empty string specifying a "type" for this shipment. This feature can be used to define incompatibilities or requirements between Differs from |
label | Specifies a label for this shipment. This label is reported in the response in the |
ignore | If true, skip this shipment, but don't apply a Ignoring a shipment results in a validation error when there are any Ignoring a shipment that is performed in |
penalty_cost | If the shipment is not completed, this penalty is added to the overall cost of the routes. A shipment is considered completed if one of its pickup and delivery alternatives is visited. The cost may be expressed in the same unit used for all other cost-related fields in the model and must be positive. IMPORTANT : If this penalty is not specified, it is considered infinite, ie the shipment must be completed. |
pickup_to_delivery_relative_detour_limit | Specifies the maximum relative detour time compared to the shortest path from pickup to delivery. If specified, it must be nonnegative, and the shipment must contain at least a pickup and a delivery. For example, let t be the shortest time taken to go from the selected pickup alternative directly to the selected delivery alternative. Then setting If both relative and absolute limits are specified on the same shipment, the more constraining limit is used for each possible pickup/delivery pair. As of 2017/10, detours are only supported when travel durations do not depend on vehicles. |
بار
When performing a visit, a predefined amount may be added to the vehicle load if it's a pickup, or subtracted if it's a delivery. This message defines such amount. See load_demands .
| فیلدها | |
|---|---|
amount | The amount by which the load of the vehicle performing the corresponding visit will vary. Since it is an integer, users are advised to choose an appropriate unit to avoid loss of precision. Must be ≥ 0. |
VisitRequest
Request for a visit which can be done by a vehicle: it has a geo-location (or two, see below), opening and closing times represented by time windows, and a service duration time (time spent by the vehicle once it has arrived to pickup or drop off goods).
| فیلدها | |
|---|---|
arrival_location | The geo-location where the vehicle arrives when performing this |
arrival_waypoint | The waypoint where the vehicle arrives when performing this |
departure_location | The geo-location where the vehicle departs after completing this |
departure_waypoint | The waypoint where the vehicle departs after completing this |
tags[] | Specifies tags attached to the visit request. Empty or duplicate strings are not allowed. |
time_windows[] | Time windows which constrain the arrival time at a visit. Note that a vehicle may depart outside of the arrival time window, ie arrival time + duration do not need to be inside a time window. This can result in waiting time if the vehicle arrives before The absence of Time windows must be disjoint, ie no time window must overlap with or be adjacent to another, and they must be in increasing order. |
duration | Duration of the visit, ie time spent by the vehicle between arrival and departure (to be added to the possible waiting time; see |
cost | Cost to service this visit request on a vehicle route. This can be used to pay different costs for each alternative pickup or delivery of a shipment. This cost must be in the same unit as |
load_demands | Load demands of this visit request. This is just like |
visit_types[] | Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see A type can only appear once. |
label | Specifies a label for this |
avoid_u_turns | Specifies whether U-turns should be avoided in driving routes at this location. U-turn avoidance is best effort and complete avoidance is not guaranteed. This is an experimental feature and behavior is subject to change. Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/u-turn-avoidance/make-request for more details. |
ShipmentModel
A shipment model contains a set of shipments which must be performed by a set of vehicles, while minimizing the overall cost, which is the sum of:
- the cost of routing the vehicles (sum of cost per total time, cost per travel time, and fixed cost over all vehicles).
- the unperformed shipment penalties.
- the cost of the global duration of the shipments
| فیلدها | |
|---|---|
shipments[] | Set of shipments which must be performed in the model. |
vehicles[] | Set of vehicles which can be used to perform visits. |
objectives[] | The set of objectives for this model, that we will transform into costs. If not empty, the input model has to be costless. To obtain the modified request, please use Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request for more details. |
global_start_time | Global start and end time of the model: no times outside of this range can be considered valid. The model's time span must be less than a year, ie the When using |
global_end_time | If unset, 00:00:00 UTC, January 1, 1971 (ie seconds: 31536000, nanos: 0) is used as default. |
global_duration_cost_per_hour | The "global duration" of the overall plan is the difference between the earliest effective start time and the latest effective end time of all vehicles. Users can assign a cost per hour to that quantity to try and optimize for earliest job completion, for example. This cost must be in the same unit as |
duration_distance_matrices[] | Specifies duration and distance matrices used in the model. If this field is empty, Google Maps or geodesic distances will be used instead, depending on the value of the Usage examples:
|
duration_distance_matrix_src_tags[] | Tags defining the sources of the duration and distance matrices; Tags correspond to |
duration_distance_matrix_dst_tags[] | Tags defining the destinations of the duration and distance matrices; Tags correspond to |
transition_attributes[] | Transition attributes added to the model. |
shipment_type_incompatibilities[] | Sets of incompatible shipment_types (see |
shipment_type_requirements[] | Sets of |
precedence_rules[] | Set of precedence rules which must be enforced in the model. IMPORTANT : Use of precedence rules limits the size of problem that can be optimized. Requests using precedence rules that include many shipments may be rejected. |
max_active_vehicles | Constrains the maximum number of active vehicles. A vehicle is active if its route performs at least one shipment. This can be used to limit the number of routes in the case where there are fewer drivers than vehicles and that the fleet of vehicles is heterogeneous. The optimization will then select the best subset of vehicles to use. Must be strictly positive. |
DurationDistanceMatrix
Specifies a duration and distance matrix from visit and vehicle start locations to visit and vehicle end locations.
| فیلدها | |
|---|---|
rows[] | Specifies the rows of the duration and distance matrix. It must have as many elements as |
vehicle_start_tag | Tag defining to which vehicles this duration and distance matrix applies. If empty, this applies to all vehicles, and there can only be a single matrix. Each vehicle start must match exactly one matrix, ie exactly one of their All matrices must have a different |
ردیف
Specifies a row of the duration and distance matrix.
| فیلدها | |
|---|---|
durations[] | Duration values for a given row. It must have as many elements as |
meters[] | Distance values for a given row. If no costs or constraints refer to distances in the model, this can be left empty; otherwise it must have as many elements as |
Objective
Objectives replace the cost model completely, and are therefore incompatible with pre-existing costs. Each objective maps to a number of pre-defined costs for, eg, vehicles, shipments or transition attributes.
Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request for more details.
| فیلدها | |
|---|---|
type | The type of the objective. |
weight | How much this objective should count relatively to the others. This can be any non-negative number, weights do not have to sum to 1. Weights default to 1.0. |
نوع
The objective type that will be mapped to a set of costs.
| انومها | |
|---|---|
DEFAULT | A default set of costs will be used, to ensure a reasonable solution. Note: this objective can be used on its own, but will also always be added with weight 1.0, as a baseline, to the objectives specified by the user, if it's not already present. |
MIN_DISTANCE | "MIN" objectives. Minimize the total distance traveled. |
MIN_WORKING_TIME | Minimize the total working time, summed over all vehicles. |
MIN_TRAVEL_TIME | Same as above but focusing on travel time only. |
MIN_NUM_VEHICLES | Minimize the number of vehicles used. |
PrecedenceRule
A precedence rule between two events (each event is the pickup or the delivery of a shipment): the "second" event has to start at least offset_duration after "first" has started.
Several precedences can refer to the same (or related) events, eg, "pickup of B happens after delivery of A" and "pickup of C happens after pickup of B".
Furthermore, precedences only apply when both shipments are performed and are otherwise ignored.
| فیلدها | |
|---|---|
first_is_delivery | Indicates if the "first" event is a delivery. |
second_is_delivery | Indicates if the "second" event is a delivery. |
offset_duration | The offset between the "first" and "second" event. It can be negative. |
first_index | Shipment index of the "first" event. This field must be specified. |
second_index | Shipment index of the "second" event. This field must be specified. |
ShipmentRoute
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, ie 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 | | | | ||
|| | | | | | | ||
--++-----------------------------------------------------------------++-->
| فیلدها | |
|---|---|
vehicle_index | Vehicle performing the route, identified by its index in the source |
vehicle_label | Label of the vehicle performing this route, equal to |
vehicle_start_time | Time at which the vehicle starts its route. |
vehicle_end_time | Time at which the vehicle finishes its route. |
visits[] | 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. |
transitions[] | Ordered list of transitions for the route. |
has_traffic_infeasibilities | When Arrival at next_visit will likely happen later than its current time window due the increased estimate of travel time |
route_polyline | The encoded polyline representation of the route. This field is only populated if |
breaks[] | Breaks scheduled for the vehicle performing this route. The |
metrics | Duration, distance and load metrics for this route. The fields of |
vehicle_fullness | Experimental: This field's behavior or existence may change in future. |
route_costs | Cost of the route, broken down by cost-related request fields. The keys are proto paths, relative to the input OptimizeToursRequest, eg "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. |
route_total_cost | Total cost of the route. The sum of all costs in the cost map. |
شکستن
Data representing the execution of a break.
| فیلدها | |
|---|---|
start_time | Start time of a break. |
duration | Duration of a break. |
EncodedPolyline
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 .
| فیلدها | |
|---|---|
points | String representing encoded points of the polyline. |
گذار
Transition between two events on the route. See the description of ShipmentRoute .
If the vehicle does not have a start_location and/or end_location , the corresponding travel metrics are 0.
| فیلدها | |
|---|---|
travel_duration | Travel duration during this transition. |
travel_distance_meters | Distance traveled during the transition. |
traffic_info_unavailable | When traffic is requested via |
delay_duration | Sum of the delay durations applied to this transition. If any, the delay starts exactly |
break_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 |
wait_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. |
total_duration | Total duration of the transition, provided for convenience. It is equal to:
|
start_time | Start time of this transition. |
route_polyline | The encoded polyline representation of the route followed during the transition. This field is only populated if |
route_token | Output only. An opaque token that can be passed to Navigation SDK to reconstruct the route during navigation, and, in the event of rerouting, honor the original intention when the route was created. Treat this token as an opaque blob. Don't compare its value across requests as its value may change even if the service returns the exact same route. This field is only populated if |
vehicle_loads | Vehicle loads during this transition, for each type that either appears in this vehicle's The loads during the first transition are the starting loads of the vehicle route. Then, after each visit, the visit's |
VehicleLoad
Reports the actual load of the vehicle at some point along the route, for a given type (see Transition.vehicle_loads ).
| فیلدها | |
|---|---|
amount | The amount of load on the vehicle, for the given type. The unit of load is usually indicated by the type. See |
بازدید
A visit performed during a route. This visit corresponds to a pickup or a delivery of a Shipment .
| فیلدها | |
|---|---|
shipment_index | Index of the |
is_pickup | If true the visit corresponds to a pickup of a |
visit_request_index | Index of |
start_time | Time at which the visit starts. Note that the vehicle may arrive earlier than this at the visit location. Times are consistent with the |
load_demands | Total visit load demand as the sum of the shipment and the visit request |
detour | 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: Otherwise, it is computed from the vehicle |
shipment_label | Copy of the corresponding |
visit_label | Copy of the corresponding |
injected_solution_location_token | An opaque token representing information about a visit location. This field may be populated in the result routes' visits when Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/u-turn-avoidance/make-request for more details. |
ShipmentTypeIncompatibility
Specifies incompatibilties between shipments depending on their shipment_type. The appearance of incompatible shipments on the same route is restricted based on the incompatibility mode.
| فیلدها | |
|---|---|
types[] | List of incompatible types. Two shipments having different |
incompatibility_mode | Mode applied to the incompatibility. |
IncompatibilityMode
Modes defining how the appearance of incompatible shipments are restricted on the same route.
| انومها | |
|---|---|
INCOMPATIBILITY_MODE_UNSPECIFIED | Unspecified incompatibility mode. This value should never be used. |
NOT_PERFORMED_BY_SAME_VEHICLE | In this mode, two shipments with incompatible types can never share the same vehicle. |
NOT_IN_SAME_VEHICLE_SIMULTANEOUSLY | In this mode, two shipments with incompatible types can never be on the same vehicle at the same time:
|
ShipmentTypeRequirement
Specifies requirements between shipments based on their shipment_type. The specifics of the requirement are defined by the requirement mode.
| فیلدها | |
|---|---|
required_shipment_type_alternatives[] | List of alternative shipment types required by the |
dependent_shipment_types[] | All shipments with a type in the NOTE: Chains of requirements such that a |
requirement_mode | Mode applied to the requirement. |
RequirementMode
Modes defining the appearance of dependent shipments on a route.
| انومها | |
|---|---|
REQUIREMENT_MODE_UNSPECIFIED | Unspecified requirement mode. This value should never be used. |
PERFORMED_BY_SAME_VEHICLE | In this mode, all "dependent" shipments must share the same vehicle as at least one of their "required" shipments. |
IN_SAME_VEHICLE_AT_PICKUP_TIME | With the A "dependent" shipment pickup must therefore have either:
|
IN_SAME_VEHICLE_AT_DELIVERY_TIME | Same as before, except the "dependent" shipments need to have a "required" shipment on their vehicle at the time of their delivery . |
SkippedShipment
Specifies details of unperformed shipments in a solution. For trivial cases and/or if we are able to identify the cause for skipping, we report the reason here.
| فیلدها | |
|---|---|
index | The index corresponds to the index of the shipment in the source |
label | Copy of the corresponding |
reasons[] | A list of reasons that explain why the shipment was skipped. See comment above |
penalty_cost | This is a copy of the Experimental: This field's behavior or existence may change in future. |
estimated_incompatible_vehicle_ratio | Estimated ratio of vehicles that cannot perform this shipment for at least one of the reasons below. Note: this is only filled when reasons involve a vehicle. Experimental: This field's behavior or existence may change in future. |
دلیل
If we can explain why the shipment was skipped, reasons will be listed here. If the reason is not the same for all vehicles, reason will have more than 1 element. A skipped shipment cannot have duplicate reasons, ie where all fields are the same except for example_vehicle_index . Example:
reasons {
code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
example_vehicle_index: 1
example_exceeded_capacity_type: "Apples"
}
reasons {
code: DEMAND_EXCEEDS_VEHICLE_CAPACITY
example_vehicle_index: 3
example_exceeded_capacity_type: "Pears"
}
reasons {
code: CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT
example_vehicle_index: 1
}
The skipped shipment is incompatible with all vehicles. The reasons may be different for all vehicles but at least one vehicle's "Apples" capacity would be exceeded (including vehicle 1), at least one vehicle's "Pears" capacity would be exceeded (including vehicle 3) and at least one vehicle's distance limit would be exceeded (including vehicle 1).
| فیلدها | |
|---|---|
code | Refer to the comments of Code. |
example_vehicle_indices[] | Same as Experimental: This field's behavior or existence may change in future. |
example_exceeded_capacity_type | If the reason code is |
example_vehicle_index | If the reason is related to a shipment-vehicle incompatibility, this field provides the index of one relevant vehicle. |
کد
Code identifying the reason type. The order here is meaningless. In particular, it gives no indication of whether a given reason will appear before another in the solution, if both apply.
| انومها | |
|---|---|
CODE_UNSPECIFIED | This should never be used. |
NO_VEHICLE | There is no vehicle in the model making all shipments infeasible. |
DEMAND_EXCEEDS_VEHICLE_CAPACITY | The demand of the shipment exceeds a vehicle's capacity for some capacity types, one of which is example_exceeded_capacity_type . |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DISTANCE_LIMIT | The minimum distance necessary to perform this shipment, ie from the vehicle's Note that for this computation we use the geodesic distances. |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT | The minimum time necessary to perform this shipment, including travel time, wait time and service time exceeds the vehicle's Note: travel time is computed in the best-case scenario, namely as geodesic distance x 36 m/s (roughly 130 km/hour). |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TRAVEL_DURATION_LIMIT | Same as above but we only compare minimum travel time and the vehicle's travel_duration_limit . |
CANNOT_BE_PERFORMED_WITHIN_VEHICLE_TIME_WINDOWS | The vehicle cannot perform this shipment in the best-case scenario (see CANNOT_BE_PERFORMED_WITHIN_VEHICLE_DURATION_LIMIT for time computation) if it starts at its earliest start time: the total time would make the vehicle end after its latest end time. |
VEHICLE_NOT_ALLOWED | The allowed_vehicle_indices field of the shipment is not empty and this vehicle does not belong to it. |
VEHICLE_IGNORED | The vehicle's Experimental: This field's behavior or existence may change in future. |
SHIPMENT_IGNORED | The shipment's Experimental: This field's behavior or existence may change in future. |
SKIPPED_IN_INJECTED_SOLUTION_CONSTRAINT | The shipment is skipped in the Experimental: This field's behavior or existence may change in future. |
VEHICLE_ROUTE_IS_FULLY_SEQUENCE_CONSTRAINED | The vehicle route relaxation specified in the Experimental: This field's behavior or existence may change in future. |
ZERO_PENALTY_COST | The shipment has a zero penalty cost. While this can be useful as an advanced modelling choice, it may also explain after the fact why a shipment was skipped. Experimental: This field's behavior or existence may change in future. |
TimeWindow
Time windows constrain the time of an event, such as the arrival time at a visit, or the start and end time of a vehicle.
Hard time window bounds, start_time and end_time , enforce the earliest and latest time of the event, such that start_time <= event_time <= end_time . The soft time window lower bound, soft_start_time , expresses a preference for the event to happen at or after soft_start_time by incurring a cost proportional to how long before soft_start_time the event occurs. The soft time window upper bound, soft_end_time , expresses a preference for the event to happen at or before soft_end_time by incurring a cost proportional to how long after soft_end_time the event occurs. start_time , end_time , soft_start_time and soft_end_time should be within the global time limits (see ShipmentModel.global_start_time and ShipmentModel.global_end_time ) and should respect:
0 <= `start_time` <= `end_time` and
0 <= `start_time` <= `soft_start_time` and
0 <= `soft_end_time` <= `end_time`.
| فیلدها | |
|---|---|
start_time | The hard time window start time. If unspecified it will be set to |
end_time | The hard time window end time. If unspecified it will be set to |
soft_start_time | The soft start time of the time window. |
soft_end_time | The soft end time of the time window. |
cost_per_hour_before_soft_start_time | A cost per hour added to other costs in the model if the event occurs before soft_start_time, computed as: This cost must be positive, and the field can only be set if soft_start_time has been set. |
cost_per_hour_after_soft_end_time | A cost per hour added to other costs in the model if the event occurs after This cost must be positive, and the field can only be set if |
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).
| فیلدها | |
|---|---|
src_tag | Tags defining the set of (src->dst) transitions these attributes apply to. A source visit or vehicle start matches iff its |
excluded_src_tag | See |
dst_tag | A destination visit or vehicle end matches iff its |
excluded_dst_tag | See |
cost | 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 | Specifies a cost per kilometer applied to the distance traveled while performing this transition. It adds up to any |
distance_limit | Specifies a limit on the distance traveled while performing this transition. As of 2021/06, only soft limits are supported. |
delay | Specifies a delay incurred when performing this transition. This delay always occurs after finishing the source visit and before starting the destination visit. |
اوری
A Universal Resource Identifier that points to a resource that can be read and written by the Route Optimization API.
| فیلدها | |
|---|---|
uri | The URI of the resource. The resource may not yet exist. The contents of the resource are encoded as either JSON or textproto. Only Google Cloud Storage resources are supported. If the resource is encoded as JSON, the resource name must be suffixed with |
وسیله نقلیه
Models a vehicle in a shipment problem. Solving a shipment problem will build a route starting from start_location and ending at end_location for this vehicle. A route is a sequence of visits (see ShipmentRoute ).
| فیلدها | |
|---|---|
display_name | The user-defined display name of the vehicle. It can be up to 63 characters long and may use UTF-8 characters. |
travel_mode | The travel mode which affects the roads usable by the vehicle and its speed. See also |
route_modifiers | A set of conditions to satisfy that affect the way routes are calculated for the given vehicle. |
start_location | Geographic location where the vehicle starts before picking up any shipments. If not specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, |
start_waypoint | Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither |
end_location | Geographic location where the vehicle ends after it has completed its last |
end_waypoint | Waypoint representing a geographic location where the vehicle ends after it has completed its last |
start_tags[] | Specifies tags attached to the start of the vehicle's route. Empty or duplicate strings are not allowed. |
end_tags[] | Specifies tags attached to the end of the vehicle's route. Empty or duplicate strings are not allowed. |
start_time_windows[] | Time windows during which the vehicle may depart its start location. They must be within the global time limits (see Time windows belonging to the same repeated field must be disjoint, ie no time window can overlap with or be adjacent to another, and they must be in chronological order. |
end_time_windows[] | Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see Time windows belonging to the same repeated field must be disjoint, ie no time window can overlap with or be adjacent to another, and they must be in chronological order. |
unloading_policy | Unloading policy enforced on the vehicle. |
load_limits | Capacities of the vehicle (weight, volume, # of pallets for example). The keys in the map are the identifiers of the type of load, consistent with the keys of the |
cost_per_hour | Vehicle costs: all costs add up and must be in the same unit as Cost per hour of the vehicle route. This cost is applied to the total time taken by the route, and includes travel time, waiting time, and visit time. Using |
cost_per_traveled_hour | Cost per traveled hour of the vehicle route. This cost is applied only to travel time taken by the route (ie, that reported in |
cost_per_kilometer | Cost per kilometer of the vehicle route. This cost is applied to the distance reported in the |
fixed_cost | Fixed cost applied if this vehicle is used to handle a shipment. |
used_if_route_is_empty | This field only applies to vehicles when their route does not serve any shipments. It indicates if the vehicle should be considered as used or not in this case. If true, the vehicle goes from its start to its end location even if it doesn't serve any shipments, and time and distance costs resulting from its start --> end travel are taken into account. Otherwise, it doesn't travel from its start to its end location, and no |
route_duration_limit | Limit applied to the total duration of the vehicle's route. In a given |
travel_duration_limit | Limit applied to the travel duration of the vehicle's route. In a given |
route_distance_limit | Limit applied to the total distance of the vehicle's route. In a given |
extra_visit_duration_for_visit_type | Specifies a map from visit_types strings to durations. The duration is time in addition to If a visit request has multiple types, a duration will be added for each type in the map. |
break_rule | Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle. |
label | Specifies a label for this vehicle. This label is reported in the response as the |
ignore | If true, If a shipment is performed by an ignored vehicle in If a shipment is performed by an ignored vehicle in |
travel_duration_multiple | Specifies a multiplicative factor that can be used to increase or decrease travel times of this vehicle. For example, setting this to 2.0 means that this vehicle is slower and has travel times that are twice what they are for standard vehicles. This multiple does not affect visit durations. It does affect cost if WARNING: Travel times will be rounded to the nearest second after this multiple is applied but before performing any numerical operations, thus, a small multiple may result in a loss of precision. See also |
DurationLimit
A limit defining a maximum duration of the route of a vehicle. It can be either hard or soft.
When a soft limit field is defined, both the soft max threshold and its associated cost must be defined together.
| فیلدها | |
|---|---|
max_duration | A hard limit constraining the duration to be at most max_duration. |
soft_max_duration | A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost. This cost adds up to other costs defined in the model, with the same unit. If defined, |
quadratic_soft_max_duration | A soft limit not enforcing a maximum duration limit, but when violated makes the route incur a cost, quadratic in the duration. This cost adds up to other costs defined in the model, with the same unit. If defined, |
cost_per_hour_after_soft_max | Cost per hour incurred if the The cost must be nonnegative. |
cost_per_square_hour_after_quadratic_soft_max | Cost per square hour incurred if the The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows: The cost must be nonnegative. |
LoadLimit
Defines a load limit applying to a vehicle, eg "this truck may only carry up to 3500 kg". See load_limits .
| فیلدها | |
|---|---|
soft_max_load | A soft limit of the load. See |
cost_per_unit_above_soft_max | If the load ever exceeds |
start_load_interval | The acceptable load interval of the vehicle at the start of the route. |
end_load_interval | The acceptable load interval of the vehicle at the end of the route. |
max_load | The maximum acceptable amount of load. |
cost_per_kilometer | Cost of moving one unit of load over one kilometer for this vehicle. This can be used as a proxy for fuel consumption: if the load is a weight (in Newtons), then load*kilometer has the dimension of an energy. Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request for more details. |
cost_per_traveled_hour | Cost of traveling with a unit of load during one hour for this vehicle. Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request for more details. |
فاصله
Interval of acceptable load amounts.
| فیلدها | |
|---|---|
min | A minimum acceptable load. Must be ≥ 0. If they're both specified, |
max | A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum load is unrestricted by this message. If they're both specified, |
LoadCost
Cost of moving one unit of load during a Transition . For a given load, the cost is the sum of two parts:
- min(load,
load_threshold) *cost_per_unit_below_threshold - max(0, load -
load_threshold) *cost_per_unit_above_threshold
With this cost, solutions prefer to deliver high demands first, or equivalently pickup high demands last. For example, if a vehicle has
load_limit {
key: "weight"
value {
cost_per_kilometer {
load_threshold: 15
cost_per_unit_below_threshold: 2.0
cost_per_unit_above_threshold: 10.0
}
}
}
and its route is start,pickup,pickup,delivery,delivery,end with transitions:
transition { vehicle_load['weight'] { amount: 0 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 10 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 20 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 10 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 0 }
travel_distance_meters: 1000.0 }
then the cost incurred by this LoadCost is (cost_below * load_below * kilometers + cost_above * load_above * kms)
- transition 0: 0.0
- transition 1: 2.0 * 10 * 1.0 + 10.0 * 0 * 1.0 = 20.0
- transition 2: 2.0 * 15 * 1.0 + 10.0 * (20 - 15) * 1.0 = 80.0
- transition 3: 2.0 * 10 * 1.0 + 10.0 * 0 * 1.0 = 20.0
- transition 4: 0.0
So the LoadCost over the route is 120.0.
However, if the route is start,pickup,delivery,pickup,delivery,end with transitions:
transition { vehicle_load['weight'] { amount: 0 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 10 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 0 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 10 }
travel_distance_meters: 1000.0 }
transition { vehicle_load['weight'] { amount: 0 }
travel_distance_meters: 1000.0 }
then the cost incurred by this LoadCost is
- transition 0: 0.0
- transition 1: 2.0 * 10 * 1.0 + 10.0 * 0 * 1.0 = 20.0
- transition 2: 0.0
- transition 3: 2.0 * 10 * 1.0 + 10.0 * 0 * 1.0 = 20.0
- transition 4: 0.0
Here the LoadCost over the route is 40.0.
LoadCost makes solutions with heavy-loaded transitions more expensive.
Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/load-cost/make-request for more details.
| فیلدها | |
|---|---|
load_threshold | Amount of load above which the cost of moving a unit of load changes from cost_per_unit_below_threshold to cost_per_unit_above_threshold. Must be >= 0. |
cost_per_unit_below_threshold | Cost of moving a unit of load, for each unit between 0 and threshold. Must be a finite value, and >= 0. |
cost_per_unit_above_threshold | Cost of moving a unit of load, for each unit above threshold. In the special case threshold = 0, this is a fixed cost per unit. Must be a finite value, and >= 0. |
TravelMode
Travel modes which can be used by vehicles.
These should be a subset of the Google Maps Platform Routes API travel modes, see: https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode
Note: WALKING routes are in beta and might sometimes be missing clear sidewalks or pedestrian paths. You must display this warning to the user for all walking routes that you display in your app.
| انومها | |
|---|---|
TRAVEL_MODE_UNSPECIFIED | Unspecified travel mode, equivalent to DRIVING . |
DRIVING | Travel mode corresponding to driving directions (car, ...). |
WALKING | Travel mode corresponding to walking directions. |
UnloadingPolicy
Policy on how a vehicle can be unloaded. Applies only to shipments having both a pickup and a delivery.
Other shipments are free to occur anywhere on the route independent of unloading_policy .
| انومها | |
|---|---|
UNLOADING_POLICY_UNSPECIFIED | Unspecified unloading policy; deliveries must just occur after their corresponding pickups. |
LAST_IN_FIRST_OUT | Deliveries must occur in reverse order of pickups |
FIRST_IN_FIRST_OUT | Deliveries must occur in the same order as pickups |
VehicleFullness
VehicleFullness is a metric which computes how full a vehicle is. Each VehicleFullness field is between 0 and 1, computed as the ratio between a capped metric field (eg AggregatedMetrics.travel_distance_meters ) and its related vehicle limit (eg Vehicle.route_distance_limit ), if it exists. Otherwise the fullness ratio stays unset. If the limit is 0, the field is set to 1. Note: when a route is subject to traffic infeasibilities, some raw fullness ratios might exceed 1.0, eg the vehicle might exceed its distance limit. In these cases, we cap the fullness values at 1.0.
| فیلدها | |
|---|---|
max_fullness | Maximum of all other fields in this message. |
distance | The ratio between |
travel_duration | The ratio between [AggregatedMetrics.travel_duration_seconds][] and |
active_duration | The ratio between [AggregatedMetrics.total_duration_seconds][] and |
max_load | The maximum ratio among all types of [AggregatedMetrics.max_load][] and their respective |
active_span | The ratio (vehicle_end_time - vehicle_start_time) / (latest_vehicle_end_time - earliest_vehicle_start_time) for a given vehicle. If the denominator is not present, it uses ( |
نقطه مسیر
Encapsulates a waypoint. Waypoints mark arrival and departure locations of VisitRequests, and start and end locations of Vehicles.
| فیلدها | |
|---|---|
side_of_road | Optional. Indicates that the location of this waypoint is meant to have a preference for the vehicle to stop at a particular side of road. When you set this value, the route will pass through the location so that the vehicle can stop at the side of road that the location is biased towards from the center of the road. This option doesn't work for the 'WALKING' travel mode. |
vehicle_stopover | Indicates that the waypoint is meant for vehicles to stop at, where the intention is to either pick up or drop off. This option works only for the 'DRIVING' travel mode, and when the 'location_type' is 'location'. Experimental: This field's behavior or existence may change in future. |
Union field location_type . Different ways to represent a location. location_type can be only one of the following: | |
location | A point specified using geographic coordinates, including an optional heading. |
place_id | The POI place ID associated with the waypoint. When using a place ID to specify arrival or departure location of a VisitRequest, use a place ID that is specific enough to determine a LatLng location for navigation to the place. For example, a place ID representing a building is suitable, but a place ID representing a road is discouraged. |