Package google.maps.routeoptimization.v1

সূচক

রুটঅপ্টিমাইজেশন

যানবাহন ভ্রমণ অপ্টিমাইজ করার জন্য একটি পরিষেবা।

নির্দিষ্ট ধরণের ক্ষেত্রের বৈধতা:

  • 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
    • অক্ষাংশ অবশ্যই [-৯০.০, ৯০.০] এর মধ্যে হতে হবে।
    • দ্রাঘিমাংশ অবশ্যই [-১৮০.০, ১৮০.০] এর মধ্যে হতে হবে।
    • অক্ষাংশ এবং দ্রাঘিমাংশের অন্তত একটি অবশ্যই শূন্য-বহির্ভূত হতে হবে।
ব্যাচঅপ্টিমাইজট্যুর

rpc BatchOptimizeTours( BatchOptimizeToursRequest ) returns ( Operation )

এক বা একাধিক OptimizeToursRequest বার্তার জন্য যানবাহন ভ্রমণ অপ্টিমাইজ করে।

এই পদ্ধতিটি একটি দীর্ঘমেয়াদী অপারেশন (LRO)। অপ্টিমাইজেশনের জন্য ইনপুট ( OptimizeToursRequest messages) এবং আউটপুট ( OptimizeToursResponse messages) ব্যবহারকারী-নির্দিষ্ট ফর্ম্যাটে ক্লাউড স্টোরেজ থেকে পড়া এবং লেখা হয়। OptimizeTours পদ্ধতির মতো, প্রতিটি OptimizeToursRequest একটি ShipmentModel থাকে এবং ShipmentRoute ক্ষেত্র ধারণকারী একটি OptimizeToursResponse প্রদান করে, যা মোট খরচ কমিয়ে যানবাহন দ্বারা সম্পাদিত রুটের একটি সেট।

ব্যবহারকারী operations.get পোল করতে পারেন। LRO-এর অবস্থা পরীক্ষা করতে পারেন:

যদি LRO done ক্ষেত্রটি মিথ্যা হয়, তাহলে অন্তত একটি অনুরোধ এখনও প্রক্রিয়াধীন রয়েছে। অন্যান্য অনুরোধগুলি সফলভাবে সম্পন্ন হতে পারে এবং তাদের ফলাফল ক্লাউড স্টোরেজে উপলব্ধ।

যদি LRO-এর done ফিল্ডটি true হয়, তাহলে সব অনুরোধ প্রক্রিয়া করা হয়েছে। যেকোনো সফলভাবে প্রক্রিয়া করা অনুরোধের ফলাফল ক্লাউড স্টোরেজে পাওয়া যাবে। যেকোনো ব্যর্থ অনুরোধের ফলাফল ক্লাউড স্টোরেজে পাওয়া যাবে না। যদি LRO-এর error ক্ষেত্রটি সেট করা থাকে, তাহলে এতে ব্যর্থ অনুরোধগুলির একটির ত্রুটি রয়েছে।

অনুমোদনের সুযোগ

নিম্নলিখিত OAuth স্কোপ প্রয়োজন:

  • https://www.googleapis.com/auth/cloud-platform
IAM অনুমতি

parent রিসোর্সে নিম্নলিখিত IAM অনুমতি প্রয়োজন:

  • routeoptimization.operations.create

আরও তথ্যের জন্য, IAM ডকুমেন্টেশন দেখুন।

অপ্টিমাইজ ট্যুরস

rpc OptimizeTours( OptimizeToursRequest ) returns ( OptimizeToursResponse )

ShipmentModel সম্বলিত একটি OptimizeToursRequest পাঠায় এবং ShipmentRoute সম্বলিত একটি OptimizeToursResponse ফেরত দেয়, যা যানবাহন দ্বারা সম্পাদিত রুটের একটি সেট যা সামগ্রিক খরচ কমিয়ে দেয়।

একটি ShipmentModel মডেলে মূলত এমন Shipment থাকে যা বহন করতে হয় এবং Vehicle যা Shipment পরিবহনের জন্য ব্যবহার করা যেতে পারে। ShipmentRoute গুলি Vehicle Shipment নির্ধারণ করে। আরও স্পষ্টভাবে বলতে গেলে, তারা প্রতিটি যানবাহনে Visit s এর একটি সিরিজ বরাদ্দ করে, যেখানে একটি Visit একটি VisitRequest এর সাথে মিলে যায়, যা একটি Shipment জন্য একটি পিকআপ বা ডেলিভারি।

লক্ষ্য হল ShipmentRoute Vehicle একটি অ্যাসাইনমেন্ট প্রদান করা যা মোট খরচ কমিয়ে আনে যেখানে ShipmentModel এ cost-এর অনেক উপাদান সংজ্ঞায়িত করা হয়েছে।

অনুমোদনের সুযোগ

নিম্নলিখিত OAuth স্কোপ প্রয়োজন:

  • https://www.googleapis.com/auth/cloud-platform
IAM অনুমতি

parent রিসোর্সে নিম্নলিখিত IAM অনুমতি প্রয়োজন:

  • routeoptimization.locations.use

আরও তথ্যের জন্য, IAM ডকুমেন্টেশন দেখুন।

অপ্টিমাইজ ট্যুরলংরানিং

rpc OptimizeToursLongRunning( OptimizeToursRequest ) returns ( Operation )

এটি OptimizeTours পদ্ধতির একটি রূপ যা বৃহৎ টাইমআউট মান সহ অপ্টিমাইজেশনের জন্য ডিজাইন করা হয়েছে। কয়েক মিনিটের বেশি সময় নেয় এমন অপ্টিমাইজেশনের জন্য OptimizeTours পদ্ধতির চেয়ে এটিকে অগ্রাধিকার দেওয়া উচিত।

ফিরে আসা long-running operation (LRO) এর একটি নাম থাকবে <parent>/operations/<operation_id> ফর্ম্যাটের এবং এটি গণনার অগ্রগতি ট্র্যাক করতে ব্যবহার করা যেতে পারে। metadata ফিল্ডের ধরণ হল OptimizeToursLongRunningMetadata । সফল হলে response ফিল্ডের ধরণ হল OptimizeToursResponse

পরীক্ষামূলক: আরও বিস্তারিত জানার জন্য https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request দেখুন।

অনুমোদনের সুযোগ

নিম্নলিখিত OAuth স্কোপ প্রয়োজন:

  • https://www.googleapis.com/auth/cloud-platform
IAM অনুমতি

parent রিসোর্সে নিম্নলিখিত IAM অনুমতি প্রয়োজন:

  • routeoptimization.operations.create

আরও তথ্যের জন্য, IAM ডকুমেন্টেশন দেখুন।

অপ্টিমাইজট্যুরসইউরি

rpc OptimizeToursUri( OptimizeToursUriRequest ) returns ( Operation )

এটি OptimizeToursLongRunning পদ্ধতির একটি রূপ যা বৃহৎ টাইমআউট মান এবং বৃহৎ ইনপুট/আউটপুট আকারের অপ্টিমাইজেশনের জন্য ডিজাইন করা হয়েছে।

ক্লায়েন্ট Google ক্লাউড স্টোরেজে সংরক্ষিত OptimizeToursRequest এর URI নির্দিষ্ট করে এবং সার্ভার ক্লায়েন্ট-নির্দিষ্ট Google ক্লাউড স্টোরেজ URI-তে OptimizeToursResponse লেখে।

এই পদ্ধতিটি OptimizeTours পদ্ধতির চেয়ে বেশি পছন্দ করা উচিত, যেখানে কয়েক মিনিটের বেশি সময় লাগে এবং 8MB এর চেয়ে বড় ইনপুট/আউটপুট আকার থাকে, যদিও এটি ছোট এবং ছোট অপ্টিমাইজেশনের জন্যও ব্যবহার করা যেতে পারে।

ফিরে আসা long-running operation (LRO) এর একটি নাম থাকবে <parent>/operations/<operation_id> ফর্ম্যাটের এবং এটি গণনার অগ্রগতি ট্র্যাক করতে ব্যবহার করা যেতে পারে। metadata ফিল্ডের ধরণ হল OptimizeToursLongRunningMetadata । সফল হলে, response ফিল্ডের ধরণ হল OptimizeToursUriResponse

পরীক্ষামূলক: আরও বিস্তারিত জানার জন্য https://developers.google.com/maps/tt/route-optimization/experimental/otlr/make-request দেখুন।

অনুমোদনের সুযোগ

নিম্নলিখিত OAuth স্কোপ প্রয়োজন:

  • https://www.googleapis.com/auth/cloud-platform
IAM অনুমতি

parent রিসোর্সে নিম্নলিখিত IAM অনুমতি প্রয়োজন:

  • routeoptimization.operations.create

আরও তথ্যের জন্য, IAM ডকুমেন্টেশন দেখুন।

সমষ্টিগত মেট্রিক্স

ShipmentRoute (সমস্ত OptimizeToursResponse এবং/অথবা Visit (সমস্ত ShipmentRoute Transition নির্ভর করে) উপাদানগুলির জন্য সমষ্টিগত মেট্রিক্স।

ক্ষেত্র
performed_shipment_count

int32

সম্পাদিত শিপমেন্টের সংখ্যা। মনে রাখবেন যে একটি পিকআপ এবং ডেলিভারি জোড়া শুধুমাত্র একবার গণনা করা হয়।

travel_duration

Duration

একটি রুট বা সমাধানের জন্য মোট ভ্রমণের সময়কাল।

wait_duration

Duration

একটি রুট বা সমাধানের জন্য মোট অপেক্ষার সময়কাল।

delay_duration

Duration

একটি রুট বা সমাধানের জন্য মোট বিলম্বের সময়কাল।

break_duration

Duration

একটি রুট বা সমাধানের জন্য মোট বিরতির সময়কাল।

visit_duration

Duration

একটি রুট বা সমাধানের জন্য মোট পরিদর্শনের সময়কাল।

total_duration

Duration

মোট সময়কাল উপরের সমস্ত সময়কালের যোগফলের সমান হওয়া উচিত। রুটের ক্ষেত্রে, এটি নিম্নলিখিতগুলির সাথেও মিলে যায়:

[ShipmentRoute.vehicle_end_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_end_time] - [ShipmentRoute.vehicle_start_time][google.maps.routeoptimization.v1.ShipmentRoute.vehicle_start_time]
travel_distance_meters

double

একটি রুট বা সমাধানের জন্য মোট ভ্রমণ দূরত্ব।

max_loads

map<string, VehicleLoad >

এই রুটের প্রতিটি পরিমাণের জন্য (resp. solution) সমগ্র রুটে অর্জিত সর্বোচ্চ লোড (resp. solution), সমস্ত Transition.vehicle_loads (resp. ShipmentRoute.metrics.max_loads ) এর সর্বোচ্চ হিসাবে গণনা করা হয়েছে।

performed_mandatory_shipment_count

int32

সম্পাদিত বাধ্যতামূলক চালানের সংখ্যা।

পরীক্ষামূলক: ভবিষ্যতে এই ক্ষেত্রের আচরণ বা অস্তিত্ব পরিবর্তিত হতে পারে।

performed_shipment_penalty_cost_sum

double

সম্পাদিত চালানের Shipment.penalty_cost এর যোগফল।

পরীক্ষামূলক: ভবিষ্যতে এই ক্ষেত্রের আচরণ বা অস্তিত্ব পরিবর্তিত হতে পারে।

ব্যাচঅপ্টিমাইজট্যুরমেটাডেটা

এই ধরণের কোনও ক্ষেত্র নেই।

BatchOptimizeToursRequest কলের জন্য অপারেশন মেটাডেটা।

ব্যাচঅপ্টিমাইজট্যুররিকোয়েস্ট

একটি অ্যাসিঙ্ক্রোনাস অপারেশন হিসেবে ব্যাচ অপ্টিমাইজ ট্যুর করার অনুরোধ। প্রতিটি ইনপুট ফাইলে একটি OptimizeToursRequest থাকা উচিত এবং প্রতিটি আউটপুট ফাইলে একটি OptimizeToursResponse থাকা উচিত। অনুরোধে ফাইলগুলি পড়ার/লেখার এবং পার্স করার জন্য তথ্য রয়েছে। সমস্ত ইনপুট এবং আউটপুট ফাইল একই প্রকল্পের অধীনে থাকা উচিত।

ক্ষেত্র
parent

string

প্রয়োজন। কল করার জন্য টার্গেট প্রজেক্ট এবং লোকেশন।

বিন্যাস:

  • projects/{project-id}
  • projects/{project-id}/locations/{location-id}

যদি কোনও অবস্থান নির্দিষ্ট না করা থাকে, তাহলে একটি অঞ্চল স্বয়ংক্রিয়ভাবে নির্বাচিত হবে।

model_configs[]

AsyncModelConfig

প্রয়োজনীয়। প্রতিটি ক্রয় মডেলের ইনপুট/আউটপুট তথ্য, যেমন ফাইল পাথ এবং ডেটা ফর্ম্যাট।

অ্যাসিঙ্কমডেলকনফিগ

একটি অপ্টিমাইজেশান মডেলকে অ্যাসিঙ্ক্রোনাসভাবে সমাধান করার জন্য তথ্য।

ক্ষেত্র
display_name

string

ঐচ্ছিক। ব্যবহারকারীর দ্বারা নির্ধারিত মডেলের নাম, মডেলগুলির ট্র্যাক রাখার জন্য ব্যবহারকারীরা উপনাম হিসাবে ব্যবহার করতে পারেন।

input_config

InputConfig

প্রয়োজনীয়। ইনপুট মডেল সম্পর্কে তথ্য।

output_config

OutputConfig

প্রয়োজনীয়। পছন্দসই আউটপুট অবস্থানের তথ্য।

ব্যাচঅপ্টিমাইজট্যুরপ্রতিক্রিয়া

এই ধরণের কোনও ক্ষেত্র নেই।

একটি BatchOptimizeToursRequest এর প্রতিক্রিয়া। অপারেশন সম্পন্ন হওয়ার পরে এটি দীর্ঘমেয়াদী অপারেশনে ফেরত পাঠানো হয়।

ব্রেকরুল

গাড়ির জন্য সময় বিরতি তৈরির নিয়ম (যেমন দুপুরের খাবারের বিরতি)। বিরতি হল এমন একটি ধারাবাহিক সময়কাল যখন গাড়িটি তার বর্তমান অবস্থানে অলস থাকে এবং কোনও পরিদর্শন করতে পারে না। বিরতি ঘটতে পারে:

  • দুটি পরিদর্শনের মধ্যবর্তী ভ্রমণের সময় (যার মধ্যে একটি পরিদর্শনের ঠিক আগে বা ঠিক পরে সময় অন্তর্ভুক্ত, কিন্তু একটি পরিদর্শনের মাঝখানে নয়), যে ক্ষেত্রে এটি পরিদর্শনের মধ্যে সংশ্লিষ্ট ট্রানজিট সময় বাড়িয়ে দেয়,
  • অথবা গাড়ি শুরু হওয়ার আগে (বিরতির মাঝখানে গাড়িটি শুরু নাও হতে পারে), এই ক্ষেত্রে এটি গাড়ি শুরুর সময়কে প্রভাবিত করে না।
  • অথবা গাড়ির শেষের পরে (এভাবেই, গাড়ির শেষ সময়ের সাথে)।
ক্ষেত্র
break_requests[]

BreakRequest

বিরতির ক্রম। BreakRequest বার্তাটি দেখুন।

frequency_constraints[]

FrequencyConstraint

বেশ কিছু FrequencyConstraint প্রযোজ্য হতে পারে। এই BreakRule এর BreakRequest গুলি অবশ্যই পূরণ করতে হবে। FrequencyConstraint দেখুন।

ব্রেকরিকোয়েস্ট

প্রতিটি গাড়ির ক্ষেত্রে প্রযোজ্য ব্রেকগুলির ক্রম (অর্থাৎ তাদের সংখ্যা এবং ক্রম) আগে থেকেই জানা আবশ্যক। পুনরাবৃত্ত BreakRequest গুলি সেই ক্রমটিকে সংজ্ঞায়িত করে, যে ক্রমে সেগুলি ঘটতে হবে। তাদের সময় উইন্ডো ( earliest_start_time / latest_start_time ) ওভারল্যাপ করতে পারে, তবে সেগুলি অবশ্যই ক্রমের সাথে সামঞ্জস্যপূর্ণ হতে হবে (এটি পরীক্ষা করা হয়েছে)।

ক্ষেত্র
earliest_start_time

Timestamp

আবশ্যক। বিরতির শুরুতে নিম্ন সীমা (সমেত)।

latest_start_time

Timestamp

আবশ্যক। বিরতির শুরুতে উপরের সীমা (সমেত)।

min_duration

Duration

আবশ্যক। বিরতির সর্বনিম্ন সময়কাল। অবশ্যই ধনাত্মক হতে হবে।

ফ্রিকোয়েন্সি সীমাবদ্ধতা

উপরে উল্লেখিত বিরতির ফ্রিকোয়েন্সি এবং সময়কালকে আরও সীমাবদ্ধ করা যেতে পারে, একটি ন্যূনতম বিরতির ফ্রিকোয়েন্সি প্রয়োগ করে, যেমন "প্রতি 12 ঘন্টায় কমপক্ষে 1 ঘন্টা বিরতি থাকা আবশ্যক"। ধরে নিচ্ছি যে এটিকে "12 ঘন্টার যেকোনো স্লাইডিং টাইম উইন্ডোর মধ্যে, কমপক্ষে এক ঘন্টার কমপক্ষে একটি বিরতি থাকা আবশ্যক" হিসাবে ব্যাখ্যা করা যেতে পারে, সেই উদাহরণটি নিম্নলিখিত FrequencyConstraint অনুবাদ করবে:

{
   min_break_duration { seconds: 3600 }         # 1 hour.
   max_inter_break_duration { seconds: 39600 }  # 11 hours (12 - 1 = 11).
}

সমাধানে বিরতির সময় এবং সময়কাল BreakRequest এ ইতিমধ্যেই নির্দিষ্ট করা সময় উইন্ডো এবং ন্যূনতম সময়কাল ছাড়াও, এই সমস্ত সীমাবদ্ধতাগুলিকে সম্মান করবে।

একটি FrequencyConstraint বাস্তবে অ-পরপর বিরতির ক্ষেত্রে প্রযোজ্য হতে পারে। উদাহরণস্বরূপ, নিম্নলিখিত সময়সূচী "প্রতি 12 ঘন্টায় 1 ঘন্টা" উদাহরণকে সম্মান করে:

  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

Duration

প্রয়োজনীয়। এই সীমাবদ্ধতার জন্য ন্যূনতম বিরতির সময়কাল। অ-ঋণাত্মক। FrequencyConstraint বিবরণ দেখুন।

max_inter_break_duration

Duration

প্রয়োজনীয়। রুটে যেকোনো সময়ের ব্যবধানের সর্বোচ্চ অনুমোদিত স্প্যান, যাতে অন্তত আংশিকভাবে duration >= min_break_duration । অবশ্যই ধনাত্মক হতে হবে।

ডেটাফরম্যাট

ইনপুট এবং আউটপুট ফাইলের জন্য ডেটা ফর্ম্যাট।

এনামস
DATA_FORMAT_UNSPECIFIED অবৈধ মান, ফর্ম্যাটটি অনির্দিষ্ট করা যাবে না।
JSON জাভাস্ক্রিপ্ট অবজেক্ট নোটেশন।
PROTO_TEXT প্রোটোকল বাফার টেক্সট ফরম্যাট। https://protobuf.dev/reference/protobuf/textformat-spec/ দেখুন

দূরত্বসীমা

একটি সীমা যা সর্বোচ্চ কত দূরত্ব অতিক্রম করা যেতে পারে তা নির্ধারণ করে। এটি শক্ত বা নরম উভয়ই হতে পারে।

যদি একটি সফট লিমিট সংজ্ঞায়িত করা হয়, তাহলে soft_max_meters এবং cost_per_kilometer_above_soft_max উভয়কেই সংজ্ঞায়িত করতে হবে এবং অ-ঋণাত্মক হতে হবে।

ক্ষেত্র
max_meters

int64

একটি কঠিন সীমা যা দূরত্বকে সর্বোচ্চ সর্বোচ্চ_মিটার হতে বাধ্য করে। সীমাটি অবশ্যই অঋণাত্মক হতে হবে।

soft_max_meters

int64

একটি নরম সীমা সর্বোচ্চ দূরত্বের সীমা কার্যকর করে না, কিন্তু লঙ্ঘন করলে এমন একটি খরচ হয় যা একই ইউনিটের সাথে মডেলে সংজ্ঞায়িত অন্যান্য খরচের সাথে যোগ হয়।

যদি সংজ্ঞায়িত করা হয়, তাহলে soft_max_meters অবশ্যই max_meters এর চেয়ে কম হতে হবে এবং অ-ঋণাত্মক হতে হবে।

cost_per_kilometer_below_soft_max

double

প্রতি কিলোমিটারে খরচ, সূত্র সহ soft_max_meters পর্যন্ত বৃদ্ধি পাচ্ছে:

  min(distance_meters, soft_max_meters) / 1000.0 *
  cost_per_kilometer_below_soft_max.

এই খরচ route_distance_limit তে সমর্থিত নয়।

cost_per_kilometer_above_soft_max

double

দূরত্ব soft_max_meters সীমার বেশি হলে প্রতি কিলোমিটারে খরচ হবে। দূরত্ব সীমার নিচে থাকলে অতিরিক্ত খরচ 0 হবে, অন্যথায় খরচ গণনা করার জন্য ব্যবহৃত সূত্রটি নিম্নরূপ:

  (distance_meters - soft_max_meters) / 1000.0 *
  cost_per_kilometer_above_soft_max.

খরচ অবশ্যই অ-ঋণাত্মক হতে হবে।

Gcsগন্তব্য

গুগল ক্লাউড স্টোরেজের অবস্থান যেখানে আউটপুট ফাইল(গুলি) লেখা হবে।

ক্ষেত্র
uri

string

প্রয়োজনীয়। গুগল ক্লাউড স্টোরেজ ইউআরআই।

জিসিএসসোর্স

গুগল ক্লাউড স্টোরেজের অবস্থান যেখানে ইনপুট ফাইলটি পড়া হবে।

ক্ষেত্র
uri

string

প্রয়োজনীয়। gs://bucket/path/to/object ফর্ম্যাট সহ একটি Google ক্লাউড স্টোরেজ অবজেক্টের URI।

ইনজেকশনের মাধ্যমে সমাধানের সীমাবদ্ধতা

অনুরোধে সমাধান অন্তর্ভুক্ত করা হয়েছে, যার মধ্যে কোন পরিদর্শন সীমাবদ্ধ করতে হবে এবং কীভাবে সেগুলি সীমাবদ্ধ করতে হবে সে সম্পর্কে তথ্য অন্তর্ভুক্ত রয়েছে।

ক্ষেত্র
routes[]

ShipmentRoute

ইনজেকশনের জন্য দ্রবণের রুট। মূল সমাধান থেকে কিছু রুট বাদ দেওয়া হতে পারে। রুট এবং বাদ দেওয়া শিপমেন্টগুলিকে injected_first_solution_routes এর জন্য তালিকাভুক্ত মৌলিক বৈধতা অনুমান পূরণ করতে হবে।

skipped_shipments[]

SkippedShipment

ইনজেকশনের জন্য দ্রবণের শিপমেন্ট বাদ দেওয়া হয়েছে। মূল দ্রবণ থেকে কিছু বাদ দেওয়া হতে পারে। routes ক্ষেত্রটি দেখুন।

constraint_relaxations[]

ConstraintRelaxation

শূন্য বা তার বেশি যানবাহনের জন্য, কখন এবং কতটা সীমাবদ্ধতা শিথিল করতে হবে তা নির্দিষ্ট করে। যদি এই ক্ষেত্রটি খালি থাকে, তাহলে সমস্ত অ-খালি যানবাহনের রুট সম্পূর্ণরূপে সীমাবদ্ধ।

সীমাবদ্ধতা শিথিলকরণ

একদল যানবাহনের জন্য, পরিদর্শনের ক্ষেত্রে কোন সীমা (সীমা) শিথিল করা হবে এবং কোন স্তরে তা নির্দিষ্ট করে। skipped_shipment ক্ষেত্রে তালিকাভুক্ত চালানগুলি এড়িয়ে যেতে বাধ্য; অর্থাৎ, সেগুলি সম্পাদন করা যাবে না।

ক্ষেত্র
relaxations[]

Relaxation

vehicle_indices -এ যানবাহন সহ রুটে পরিদর্শনের ক্ষেত্রে প্রযোজ্য সমস্ত পরিদর্শন সীমাবদ্ধতা শিথিলকরণ।

vehicle_indices[]

int32

যেসব যানবাহনের সূচকে ভিজিট সীমাবদ্ধতা relaxations প্রযোজ্য হয় তা নির্দিষ্ট করে। যদি খালি থাকে, তাহলে এটি ডিফল্ট হিসাবে বিবেচিত হবে এবং অন্যান্য constraint_relaxations নির্দিষ্ট করা হয়নি এমন সমস্ত যানবাহনের ক্ষেত্রে relaxations প্রযোজ্য হবে। সর্বাধিক একটি ডিফল্ট থাকতে পারে, অর্থাৎ, সর্বাধিক একটি সীমাবদ্ধতা শিথিলকরণ ক্ষেত্র খালি vehicle_indices অনুমোদিত। একটি যানবাহন সূচক শুধুমাত্র একবার তালিকাভুক্ত করা যেতে পারে, এমনকি বেশ কয়েকটি constraint_relaxations মধ্যেও।

যদি interpret_injected_solutions_using_labels সত্য হয় ( fields মন্তব্য দেখুন) তাহলে একটি যানবাহন সূচক ShipmentRoute.vehicle_index এর মতোই ম্যাপ করা হয়।

শিথিলকরণ

যদি relaxations খালি থাকে, তাহলে routes সমস্ত ভিজিটের শুরুর সময় এবং ক্রম সম্পূর্ণরূপে সীমাবদ্ধ থাকে এবং সেই রুটে কোনও নতুন ভিজিট সন্নিবেশ বা যোগ করা যাবে না। এছাড়াও, routes কোনও গাড়ির শুরু এবং শেষের সময় সম্পূর্ণরূপে সীমাবদ্ধ থাকে, যদি না গাড়িটি খালি থাকে (অর্থাৎ, কোনও ভিজিট নেই এবং মডেলে used_if_route_is_empty মিথ্যাতে সেট করা থাকে)।

relaxations(i).level একটি ভিজিট #j-এ প্রয়োগ করা সীমাবদ্ধতা শিথিলকরণ স্তর নির্দিষ্ট করে যা সন্তুষ্ট করে:

  • route.visits(j).start_time >= relaxations(i).threshold_time এবং
  • 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 এ relaxed হয় যদি এটি পূরণ করে:
  • vehicle_end_time >= relaxations(i).threshold_time এবং
  • route.visits_size() + 1 >= relaxations(i).threshold_visit_count

যদি কোনও ভিজিট threshold_visit_count বা threshold_time পূরণ করে তবে একটি শিথিলকরণ স্তর প্রয়োগ করতে একই level দুটি relaxations যোগ করুন: একটিতে শুধুমাত্র threshold_visit_count সেট এবং অন্যটিতে শুধুমাত্র threshold_time সেট। যদি কোনও ভিজিট একাধিক relaxations শর্ত পূরণ করে, তাহলে সবচেয়ে শিথিলকরণ স্তর প্রযোজ্য। ফলস্বরূপ, গাড়ির শুরু থেকে রুট ভিজিট থেকে গাড়ির শেষ পর্যন্ত, শিথিলকরণ স্তর আরও শিথিল হয়ে ওঠে: অর্থাৎ, রুট এগিয়ে যাওয়ার সাথে সাথে শিথিলকরণ স্তর হ্রাস পাচ্ছে না।

যেসব রুট ভিজিট কোনও relaxations সীমার শর্ত পূরণ করে না, সেগুলির সময় এবং ক্রম সম্পূর্ণরূপে সীমাবদ্ধ এবং এই ক্রমগুলিতে কোনও ভিজিট অন্তর্ভুক্ত করা যাবে না। এছাড়াও, যদি কোনও যানবাহনের শুরু বা শেষ কোনও শিথিলের শর্ত পূরণ না করে তবে সময় নির্দিষ্ট করা হয়, যদি না গাড়িটি খালি থাকে।

ক্ষেত্র
level

Level

threshold_time এবং কমপক্ষে threshold_visit_count পরে বা তার পরে শর্তগুলি পূরণ হলে প্রযোজ্য সীমাবদ্ধতা শিথিলকরণ স্তর।

threshold_time

Timestamp

যে সময়ে বা তার পরে শিথিলকরণ level প্রয়োগ করা যেতে পারে।

threshold_visit_count

int32

শিথিলকরণ level প্রয়োগ করার সময় বা তার পরে কতবার ভিজিট করা যেতে পারে। যদি threshold_visit_count 0 হয় (অথবা সেট না করা থাকে), তাহলে গাড়ির স্টার্টের সময় সরাসরি level প্রয়োগ করা যেতে পারে।

যদি এটি route.visits_size() + 1 হয়, তাহলে level শুধুমাত্র গাড়ির প্রান্তে প্রয়োগ করা যেতে পারে। যদি এটি route.visits_size() + 1 এর চেয়ে বেশি হয়, তাহলে সেই রুটের জন্য level মোটেও প্রয়োগ করা হয় না।

স্তর

বিভিন্ন সীমাবদ্ধতা শিথিলকরণ স্তর প্রকাশ করে, যা একটি পরিদর্শনের জন্য প্রয়োগ করা হয় এবং যখন এটি থ্রেশহোল্ড শর্ত পূরণ করে তখন যেগুলি অনুসরণ করে।

নীচের গণনাটি ক্রমবর্ধমান শিথিলকরণের ক্রম অনুসারে।

এনামস
LEVEL_UNSPECIFIED

অন্তর্নিহিত ডিফল্ট শিথিলকরণ স্তর: কোনও সীমাবদ্ধতা শিথিল করা হয়নি, অর্থাৎ, সমস্ত পরিদর্শন সম্পূর্ণরূপে সীমাবদ্ধ।

এই মানটি স্পষ্টভাবে level এ ব্যবহার করা উচিত নয়।

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

DataFormat

প্রয়োজনীয়। ইনপুট ডেটা ফর্ম্যাট।

ইউনিয়ন ক্ষেত্রের source । প্রয়োজনীয়। source নিম্নলিখিতগুলির মধ্যে কেবল একটি হতে পারে:
gcs_source

GcsSource

একটি গুগল ক্লাউড স্টোরেজ লোকেশন। এটি অবশ্যই একটি একক অবজেক্ট (ফাইল) হতে হবে।

স্থান

একটি অবস্থান (একটি ভৌগোলিক বিন্দু এবং একটি ঐচ্ছিক শিরোনাম) ধারণ করে।

ক্ষেত্র
lat_lng

LatLng

ওয়েপয়েন্টের ভৌগোলিক স্থানাঙ্ক।

heading

int32

কম্পাস হেডিং ট্র্যাফিক প্রবাহের দিকের সাথে সম্পর্কিত। এই মানটি পিকআপ এবং ড্রপ-অফের জন্য ব্যবহার করা রাস্তার পাশ নির্দিষ্ট করতে ব্যবহৃত হয়। হেডিং মান 0 থেকে 360 পর্যন্ত হতে পারে, যেখানে 0 উত্তরের হেডিং নির্দেশ করে, 90 পূর্বের হেডিং নির্দেশ করে, ইত্যাদি।

অপটিমাইজ ট্যুরলংরানিংমেটাডেটা

এই ধরণের কোনও ক্ষেত্র নেই।

OptimizeToursLongRunning কলের জন্য অপারেশন মেটাডেটা।

অপ্টিমাইজ ট্যুররিকোয়েস্ট

একটি ট্যুর অপ্টিমাইজেশন সলভারকে অনুরোধ করা হবে যারা সমাধানের জন্য শিপমেন্ট মডেল এবং অপ্টিমাইজেশন প্যারামিটারগুলি সংজ্ঞায়িত করবে।

ক্ষেত্র
parent

string

প্রয়োজন। কল করার জন্য টার্গেট প্রজেক্ট বা লোকেশন।

বিন্যাস:

  • projects/{project-id}
  • projects/{project-id}/locations/{location-id}

যদি কোনও অবস্থান নির্দিষ্ট না করা থাকে, তাহলে একটি অঞ্চল স্বয়ংক্রিয়ভাবে নির্বাচিত হবে।

timeout

Duration

যদি এই টাইমআউট সেট করা থাকে, তাহলে টাইমআউট পিরিয়ড শেষ হওয়ার আগে অথবা সিঙ্ক্রোনাস রিকোয়েস্টের জন্য সার্ভারের সময়সীমা পৌঁছানোর আগে, যেটি আগে হয়, সার্ভার একটি প্রতিক্রিয়া ফেরত পাঠায়।

অ্যাসিঙ্ক্রোনাস অনুরোধের জন্য, সার্ভার সময়সীমা শেষ হওয়ার আগে একটি সমাধান (যদি সম্ভব হয়) তৈরি করবে।

model

ShipmentModel

সমাধানের জন্য চালানের মডেল।

solving_mode

SolvingMode

ডিফল্টরূপে, সমাধান মোড হল DEFAULT_SOLVE (0)।

search_mode

SearchMode

অনুরোধটি সমাধান করতে ব্যবহৃত অনুসন্ধান মোড।

injected_first_solution_routes[]

ShipmentRoute

পূর্ববর্তী সমাধানের অনুরূপ একটি প্রথম সমাধান খুঁজে বের করার জন্য অপ্টিমাইজেশন অ্যালগরিদমকে নির্দেশ করুন।

প্রথম সমাধান তৈরির সময় মডেলটি সীমাবদ্ধ থাকে। কোনও রুটে সম্পাদিত না হওয়া কোনও চালান প্রথম সমাধানে পরোক্ষভাবে এড়িয়ে যায়, তবে সেগুলি ধারাবাহিক সমাধানগুলিতে সম্পাদিত হতে পারে।

সমাধানটি অবশ্যই কিছু মৌলিক বৈধতা অনুমান পূরণ করবে:

  • সকল রুটের জন্য, vehicle_index অবশ্যই পরিসরে থাকতে হবে এবং ডুপ্লিকেট করা যাবে না।
  • সমস্ত ভিজিটের জন্য, shipment_index এবং visit_request_index অবশ্যই সীমার মধ্যে থাকতে হবে।
  • একটি চালান শুধুমাত্র একটি রুটে রেফারেন্স করা যেতে পারে।
  • পিকআপ-ডেলিভারি চালানের পিকআপ ডেলিভারির আগে করতে হবে।
  • একটি চালানের একাধিক পিকআপ বিকল্প বা ডেলিভারি বিকল্প করা যাবে না।
  • সকল রুটের জন্য, সময় বৃদ্ধি পাচ্ছে (অর্থাৎ, vehicle_start_time <= visits[0].start_time <= visits[1].start_time ... <= vehicle_end_time )।
  • শুধুমাত্র অনুমোদিত যানবাহনেই চালান করা যেতে পারে। Shipment.allowed_vehicle_indices খালি থাকলে অথবা এর vehicle_index Shipment.allowed_vehicle_indices এ অন্তর্ভুক্ত থাকলে একটি যানবাহন অনুমোদিত।

যদি ইনজেক্ট করা সমাধানটি সম্ভব না হয়, তাহলে একটি বৈধতা ত্রুটি অগত্যা ফেরত পাঠানো হবে না এবং পরিবর্তে অসম্ভাব্যতা নির্দেশ করে একটি ত্রুটি ফেরত পাঠানো হতে পারে।

injected_solution_constraint

InjectedSolutionConstraint

পূর্ববর্তী সমাধানের অনুরূপ একটি চূড়ান্ত সমাধান খুঁজে পেতে অপ্টিমাইজেশন অ্যালগরিদমকে সীমাবদ্ধ করুন। উদাহরণস্বরূপ, এটি এমন কিছু রুট হিমায়িত করতে ব্যবহার করা যেতে পারে যা ইতিমধ্যেই সম্পন্ন হয়েছে বা যা সম্পূর্ণ করতে হবে কিন্তু পরিবর্তন করা উচিত নয়।

যদি ইনজেক্ট করা সমাধানটি সম্ভব না হয়, তাহলে একটি বৈধতা ত্রুটি অগত্যা ফেরত পাঠানো হবে না এবং পরিবর্তে অসম্ভাব্যতা নির্দেশ করে একটি ত্রুটি ফেরত পাঠানো হতে পারে।

refresh_details_routes[]

ShipmentRoute

যদি খালি না থাকে, তাহলে প্রদত্ত রুটগুলি রিফ্রেশ করা হবে, তাদের পরিদর্শনের অন্তর্নিহিত ক্রম বা ভ্রমণের সময় পরিবর্তন না করে: শুধুমাত্র অন্যান্য বিবরণ আপডেট করা হবে। এটি মডেলটির সমাধান করে না।

২০২০/১১ সালের হিসাবে, এটি শুধুমাত্র খালি নয় এমন রুটের পলিলাইনগুলিকে পূরণ করে এবং populate_polylines সত্য হওয়া প্রয়োজন।

পাস-ইন রুটের route_polyline ক্ষেত্রগুলি রুট transitions সাথে অসঙ্গতিপূর্ণ হতে পারে।

এই ক্ষেত্রটি injected_first_solution_routes বা injected_solution_constraint এর সাথে একসাথে ব্যবহার করা উচিত নয়।

Shipment.ignore এবং Vehicle.ignore আচরণের উপর কোন প্রভাব ফেলে না। সম্পর্কিত চালান বা যানবাহন উপেক্ষা করা হোক না কেন, সমস্ত খালি নয় এমন রুটে সমস্ত ভিজিটের মধ্যে পলিলাইনগুলি এখনও পূরণ করা হয়।

interpret_injected_solutions_using_labels

bool

যদি সত্য হয়:

  • অনুরোধকৃত যানবাহনের সাথে ইনজেক্টেড দ্রবণে রুট মেলাতে vehicle_index এর পরিবর্তে ShipmentRoute.vehicle_label ব্যবহার করে; খালি না থাকলে ConstraintRelaxation.vehicle_indices আপডেট করার জন্য মূল ShipmentRoute.vehicle_index এর ম্যাপিং নতুন ShipmentRoute.vehicle_index এ পুনঃব্যবহার করে, তবে ম্যাপিংটি অবশ্যই দ্ব্যর্থহীন হতে হবে (অর্থাৎ, একাধিক ShipmentRoute একই মূল vehicle_index ভাগ করবে না)।
  • ইনজেক্টেড সলিউশনে ভিজিট এবং রিকোয়েস্টে থাকা শিপমেন্টের মধ্যে মিল খুঁজে পেতে shipment_index এর পরিবর্তে ShipmentRoute.Visit.shipment_label ব্যবহার করে;
  • ইনজেক্টেড সলিউশনে থাকা স্কিপড শিপমেন্টগুলিকে অনুরোধ শিপমেন্টের সাথে মেলাতে SkippedShipment.index এর পরিবর্তে SkippedShipment.label ব্যবহার করে।

এই ব্যাখ্যাটি injected_first_solution_routes , injected_solution_constraint , এবং refresh_details_routes ক্ষেত্রে প্রযোজ্য। সমাধান তৈরির পর থেকে অনুরোধে থাকা শিপমেন্ট বা যানবাহনের সূচকগুলি পরিবর্তিত হলে এটি ব্যবহার করা যেতে পারে, সম্ভবত কারণ অনুরোধ থেকে শিপমেন্ট বা যানবাহনগুলি সরানো হয়েছে বা যোগ করা হয়েছে।

যদি সত্য হয়, তাহলে নিম্নলিখিত বিভাগগুলির লেবেলগুলিকে তাদের বিভাগে সর্বাধিক একবার উপস্থিত হতে হবে:

যদি ইনজেক্টেড সলিউশনে থাকা কোনও vehicle_label কোনও অনুরোধকারী গাড়ির সাথে সামঞ্জস্যপূর্ণ না হয়, তাহলে সমাধান থেকে সংশ্লিষ্ট রুটটি তার ভিজিট সহ সরিয়ে ফেলা হয়। যদি ইনজেক্টেড সলিউশনে থাকা কোনও shipment_label কোনও অনুরোধকারী চালানের সাথে সামঞ্জস্যপূর্ণ না হয়, তাহলে সমাধান থেকে সংশ্লিষ্ট ভিজিটটি সরিয়ে ফেলা হয়। যদি ইনজেক্টেড সলিউশনে থাকা কোনও SkippedShipment.label কোনও অনুরোধকারী চালানের সাথে সামঞ্জস্যপূর্ণ না হয়, তাহলে সমাধান থেকে SkippedShipment টি সরিয়ে ফেলা হয়।

ইনজেক্টেড সলিউশন থেকে রুট ভিজিট বা সম্পূর্ণ রুট অপসারণ করলে অন্তর্নিহিত সীমাবদ্ধতার উপর প্রভাব পড়তে পারে, যার ফলে সমাধানে পরিবর্তন, বৈধতা ত্রুটি বা অসম্ভাব্যতা দেখা দিতে পারে।

দ্রষ্টব্য: কলকারীকে নিশ্চিত করতে হবে যে প্রতিটি Vehicle.label (resp. Shipment.label ) দুটি প্রাসঙ্গিক অনুরোধে ব্যবহৃত একটি যানবাহন (resp. shipment) সত্তাকে স্বতন্ত্রভাবে চিহ্নিত করে: পূর্ববর্তী অনুরোধ যা ইনজেক্টেড সলিউশনে ব্যবহৃত OptimizeToursResponse তৈরি করেছিল এবং বর্তমান অনুরোধ যাতে ইনজেক্টেড সলিউশন অন্তর্ভুক্ত ছিল। উপরে বর্ণিত স্বতন্ত্রতা পরীক্ষাগুলি এই প্রয়োজনীয়তা নিশ্চিত করার জন্য যথেষ্ট নয়।

consider_road_traffic

bool

ShipmentRoute ক্ষেত্রগুলি Transition.travel_duration , Visit.start_time , এবং vehicle_end_time গণনা করার সময়; ShipmentRoute.has_traffic_infeasibilities ক্ষেত্রটি সেট করার সময় এবং OptimizeToursResponse.total_cost ক্ষেত্রটি গণনা করার সময় ট্র্যাফিক অনুমান বিবেচনা করুন।

populate_polylines

bool

যদি সত্য হয়, তাহলে ShipmentRoute s এর প্রতিক্রিয়ায় পলিলাইনগুলি পূরণ করা হবে।

populate_transition_polylines

bool

যদি সত্য হয়, তাহলে ShipmentRoute.transitions প্রতিক্রিয়ায় পলিলাইন এবং রুট টোকেনগুলি পূরণ করা হবে।

allow_large_deadline_despite_interruption_risk

bool

যদি এটি সেট করা থাকে, তাহলে অনুরোধটির সময়সীমা ৬০ মিনিট পর্যন্ত হতে পারে ( https://grpc.io/blog/deadlines দেখুন)। অন্যথায়, সর্বোচ্চ সময়সীমা মাত্র ৩০ মিনিট। মনে রাখবেন যে দীর্ঘস্থায়ী অনুরোধগুলিতে বাধার ঝুঁকি উল্লেখযোগ্যভাবে বেশি (কিন্তু তবুও ছোট) থাকে।

use_geodesic_distances

bool

যদি সত্য হয়, তাহলে ভ্রমণের দূরত্বগুলি Google Maps দূরত্বের পরিবর্তে জিওডেসিক দূরত্ব ব্যবহার করে গণনা করা হবে এবং ভ্রমণের সময়গুলি geodesic_meters_per_second দ্বারা নির্ধারিত গতিতে জিওডেসিক দূরত্ব ব্যবহার করে গণনা করা হবে।

label

string

এই অনুরোধটি সনাক্ত করতে ব্যবহৃত হতে পারে এমন লেবেল, OptimizeToursResponse.request_label এ রিপোর্ট করা হয়েছে।

geodesic_meters_per_second

double

যখন use_geodesic_distances সত্য হয়, তখন এই ক্ষেত্রটি সেট করতে হবে এবং ভ্রমণের সময় গণনা করার জন্য প্রয়োগ করা গতি নির্ধারণ করতে হবে। এর মান কমপক্ষে 1.0 মিটার/সেকেন্ড হতে হবে।

max_validation_errors

int32

ফিরে আসা বৈধতা ত্রুটির সংখ্যা ছোট করে। এই ত্রুটিগুলি সাধারণত একটি INVALID_ARGUMENT ত্রুটি পেলোডের সাথে একটি BadRequest ত্রুটি বিবরণ ( https://cloud.google.com/apis/design/errors#error_details ) হিসাবে সংযুক্ত থাকে, যদি না solving_mode=VALIDATE_ONLY: OptimizeToursResponse.validation_errors ক্ষেত্রটি দেখুন। এটি ডিফল্টভাবে 100 এবং 10,000 এ সীমাবদ্ধ।

সার্চমোড

অনুসন্ধানের আচরণ নির্ধারণের মোড, সমাধানের গুণমান বনাম লেটেন্সি ট্রেডিং। সমস্ত মোডে, বিশ্বব্যাপী অনুরোধের সময়সীমা প্রয়োগ করা হয়।

এনামস
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

শুধুমাত্র OptimizeToursResponse.validation_errors অথবা OptimizeToursResponse.skipped_shipments পূরণ করে, এবং প্রকৃতপক্ষে অনুরোধের বাকি অংশ সমাধান করে না (প্রতিক্রিয়ায় status এবং routes সেট করা নেই)। যদি injected_solution_constraint রুটগুলিতে অসম্ভাব্যতা সনাক্ত করা হয় তবে সেগুলি OptimizeToursResponse.validation_errors ক্ষেত্রে পূরণ করা হয় এবং OptimizeToursResponse.skipped_shipments খালি রাখা হয়।

গুরুত্বপূর্ণ : এখানে সমস্ত অসম্ভব চালান ফেরত দেওয়া হয় না, তবে শুধুমাত্র প্রি-প্রসেসিংয়ের সময় অসম্ভাব্য হিসাবে শনাক্ত হওয়া চালানগুলি ফেরত দেওয়া হয়।

TRANSFORM_AND_RETURN_REQUEST

এই মোডটি শুধুমাত্র তখনই কাজ করে যদি ShipmentModel.objectives খালি না থাকে। অনুরোধটি সমাধান করা হয় না। এটি শুধুমাত্র যাচাই করা হয় এবং প্রদত্ত উদ্দেশ্যগুলির সাথে সম্পর্কিত খরচ দিয়ে পূরণ করা হয়। ShipmentModel.objectives এর ডকুমেন্টেশনও দেখুন। ফলস্বরূপ অনুরোধটি OptimizeToursResponse.processed_request হিসাবে ফেরত পাঠানো হয়।

পরীক্ষামূলক: আরও বিস্তারিত জানার জন্য https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request দেখুন।

অপ্টিমাইজ ট্যুর রেসপন্স

প্রতিটি যানবাহনের অনুসরণ করা রুট, এড়িয়ে যাওয়া চালান এবং সমাধানের সামগ্রিক খরচ সহ একটি ট্যুর অপ্টিমাইজেশন সমস্যা সমাধানের পরে প্রতিক্রিয়া।

ক্ষেত্র
routes[]

ShipmentRoute

প্রতিটি গাড়ির জন্য গণনা করা রুট; i-th রুটটি মডেলের i-th গাড়ির সাথে মিলে যায়।

request_label

string

যদি অনুরোধে কোনও লেবেল উল্লেখ করা থাকে, তাহলে OptimizeToursRequest.label এর কপি।

skipped_shipments[]

SkippedShipment

সমস্ত চালানের তালিকা বাদ দেওয়া হয়েছে।

validation_errors[]

OptimizeToursValidationError

আমরা স্বাধীনভাবে সনাক্ত করতে সক্ষম হয়েছি এমন সমস্ত বৈধতা ত্রুটির তালিকা। OptimizeToursValidationError বার্তার জন্য "MULTIPLE ERRORS" ব্যাখ্যাটি দেখুন। ত্রুটির পরিবর্তে, এতে case solving_mode হল DEFAULT_SOLVE -এ সতর্কতা অন্তর্ভুক্ত থাকবে।

processed_request

OptimizeToursRequest

কিছু ক্ষেত্রে আমরা সমাধানের আগে আগত অনুরোধটি পরিবর্তন করি, অর্থাৎ খরচ যোগ করি। যদি solving_mode == TRANSFORM_AND_RETURN_REQUEST হয়, তাহলে পরিবর্তিত অনুরোধটি এখানে ফেরত পাঠানো হবে।

পরীক্ষামূলক: আরও বিস্তারিত জানার জন্য https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request দেখুন।

metrics

Metrics

এই সমাধানের জন্য সময়কাল, দূরত্ব এবং ব্যবহারের মেট্রিক্স।

মেট্রিক্স

সমস্ত রুটের উপর সমন্বিত সামগ্রিক মেট্রিক্স।

ক্ষেত্র
aggregated_route_metrics

AggregatedMetrics

রুটগুলির উপর একত্রিত। প্রতিটি মেট্রিক হল একই নামের সমস্ত ShipmentRoute.metrics ক্ষেত্রের যোগফল (অথবা সর্বোচ্চ, লোডের জন্য)।

skipped_mandatory_shipment_count

int32

বাধ্যতামূলক চালানের সংখ্যা বাদ দেওয়া হয়েছে।

used_vehicle_count

int32

ব্যবহৃত যানবাহনের সংখ্যা। দ্রষ্টব্য: যদি কোনও যানবাহনের রুট খালি থাকে এবং Vehicle.used_if_route_is_empty সত্য হয়, তাহলে যানবাহনটি ব্যবহৃত বলে বিবেচিত হবে।

earliest_vehicle_start_time

Timestamp

ShipmentRoute.vehicle_start_time এর সমস্ত ব্যবহৃত যানবাহনের সর্বনিম্ন হিসাবে গণনা করা একটি ব্যবহৃত যানবাহনের জন্য সর্বনিম্ন শুরুর সময়।

latest_vehicle_end_time

Timestamp

ShipmentRoute.vehicle_end_time এর সমস্ত ব্যবহৃত যানবাহনের সর্বোচ্চ হিসাবে গণনা করা একটি ব্যবহৃত যানবাহনের সর্বশেষ শেষ সময়।

costs

map<string, double>

সমাধানের খরচ, খরচ-সম্পর্কিত অনুরোধ ক্ষেত্র দ্বারা বিভক্ত। কীগুলি হল প্রোটো পাথ, ইনপুট OptimizeToursRequest এর সাথে সম্পর্কিত, যেমন "model.shipments.pickups.cost", এবং মানগুলি হল সংশ্লিষ্ট খরচ ক্ষেত্র দ্বারা উৎপন্ন মোট খরচ, যা সমগ্র সমাধান জুড়ে একত্রিত করা হয়েছে। অন্য কথায়, costs["model.shipments.pickups.cost"] হল সমাধান জুড়ে সমস্ত পিকআপ খরচের যোগফল। মডেলে সংজ্ঞায়িত সমস্ত খরচ এখানে বিস্তারিতভাবে রিপোর্ট করা হয়েছে, TransitionAttributes সম্পর্কিত খরচ বাদে যা শুধুমাত্র 2022/01 অনুযায়ী সমষ্টিগতভাবে রিপোর্ট করা হয়েছে।

total_cost

double

সমাধানের মোট খরচ। খরচ মানচিত্রে সমস্ত মানের যোগফল।

অপ্টিমাইজ ট্যুরইউরিমেটাডেটা

এই ধরণের কোনও ক্ষেত্র নেই।

OptimizeToursUri কলের জন্য অপারেশন মেটাডেটা।

অপ্টিমাইজ ট্যুরইউরিরিকোয়েস্ট

OptimizeToursUri পদ্ধতি দ্বারা ব্যবহৃত একটি অনুরোধ।

ক্ষেত্র
parent

string

প্রয়োজন। কল করার জন্য টার্গেট প্রজেক্ট বা লোকেশন।

বিন্যাস:

  • projects/{project-id}
  • projects/{project-id}/locations/{location-id}

যদি কোনও অবস্থান নির্দিষ্ট না করা থাকে, তাহলে একটি অঞ্চল স্বয়ংক্রিয়ভাবে নির্বাচিত হবে।

input

Uri

প্রয়োজনীয়। OptimizeToursRequest ধারণকারী ক্লাউড স্টোরেজ অবজেক্টের URI।

output

Uri

প্রয়োজনীয়। ক্লাউড স্টোরেজ অবজেক্টের URI যাতে OptimizeToursResponse থাকবে।

অপ্টিমাইজ ট্যুরইউরিরেসপন্স

OptimizeToursUri পদ্ধতি দ্বারা একটি প্রতিক্রিয়া ফিরে এসেছে।

ক্ষেত্র
output

Uri

ঐচ্ছিক। OptimizeToursResponse ধারণকারী ক্লাউড স্টোরেজ অবজেক্টের URI JSON অথবা textproto হিসেবে এনকোড করা হয়েছে। যদি অবজেক্টটি JSON হিসেবে এনকোড করা থাকে, তাহলে অবজেক্টের নামের এক্সটেনশন হবে .json । যদি অবজেক্টটি textproto হিসেবে এনকোড করা থাকে, তাহলে অবজেক্টের নামের এক্সটেনশন হবে .txtpb

রিসোর্সের বিষয়বস্তু পরিবর্তন করা হয়নি কিনা তা যাচাই করার জন্য রিসোর্সের crc32_checksum ব্যবহার করা যেতে পারে।

OptimizeToursValidationError সম্পর্কে

OptimizeToursRequest যাচাই করার সময় সম্মুখীন হওয়া একটি ত্রুটি বা সতর্কতা বর্ণনা করে।

ক্ষেত্র
code

int32

একটি বৈধতা ত্রুটি সর্বদা উপস্থিত থাকা জোড়া ( code , display_name ) দ্বারা সংজ্ঞায়িত করা হয়।

এই বিভাগের পরবর্তী ক্ষেত্রগুলি ত্রুটি সম্পর্কে আরও প্রসঙ্গ প্রদান করে।

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 display_name="UNSPECIFIED" errors, among others. Some errors may cause the validation process to skip other errors.

STABILITY : code and display_name should be very stable. But new codes and display names may appear over time, which may cause a given (invalid) request to yield a different ( code , display_name ) pair because the new error hid the old one. For example, see "MULTIPLE ERRORS".

display_name

string

The error display name.

fields[]

FieldReference

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:

fields { name: "vehicles" index: 4}
fields { name: "shipments" index: 2 sub_field {name: "pickups" index: 0} }

Note, however, that the cardinality of fields should not change for a given error code.

error_message

string

Human-readable string describing the error. There is a 1:1 mapping between code and error_message (when code != "UNSPECIFIED").

STABILITY : Not stable: the error message associated to a given code may change (hopefully to clarify it) over time. Please rely on the display_name and code instead.

offending_values

string

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

string

Name of the field, eg, "vehicles".

sub_field

FieldReference

Recursively nested sub-field, if needed.

Union field index_or_key .

index_or_key can be only one of the following:

index

int32

Index of the field if repeated.

key

string

Key if the field is a map.

OutputConfig

Specify a destination for [BatchOptimizeTours][google.maps.routeoptimization.v1.RouteOptimizationService.BatchOptimizeTours] results.

ক্ষেত্র
data_format

DataFormat

Required. The output data format.

Union field destination . Required. destination can be only one of the following:
gcs_destination

GcsDestination

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

bool

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

bool

Specifies whether to avoid highways where reasonable. Preference will be given to routes not containing highways. Applies only to motorized travel modes.

avoid_ferries

bool

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

bool

Optional. Specifies whether to avoid navigating indoors where reasonable. Preference will be given to routes not containing indoor navigation. Applies only to the WALKING travel mode.

জাহাজে প্রেরিত কাজ

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

string

The user-defined display name of the shipment. It can be up to 63 characters long and may use UTF-8 characters.

pickups[]

VisitRequest

Set of pickup alternatives associated to the shipment. If not specified, the vehicle only needs to visit a location corresponding to the deliveries.

deliveries[]

VisitRequest

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

map<string, Load >

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[]

int32

The set of vehicles that may perform this shipment. If empty, all vehicles may perform it. Vehicles are given by their index in the ShipmentModel 's vehicles list.

costs_per_vehicle[]

double

Specifies the cost that is incurred when this shipment is delivered by each vehicle. If specified, it must have EITHER:

  • the same number of elements as costs_per_vehicle_indices . costs_per_vehicle[i] corresponds to vehicle costs_per_vehicle_indices[i] of the model.
  • the same number of elements as there are vehicles in the model. The i-th element corresponds to vehicle #i of the model.

These costs must be in the same unit as penalty_cost and must not be negative. Leave this field empty, if there are no such costs.

costs_per_vehicle_indices[]

int32

Indices of the vehicles to which costs_per_vehicle applies. If non-empty, it must have the same number of elements as costs_per_vehicle . A vehicle index may not be specified more than once. If a vehicle is excluded from costs_per_vehicle_indices , its cost is zero.

pickup_to_delivery_absolute_detour_limit

Duration

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 pickup_to_delivery_absolute_detour_limit enforces:

start_time(delivery) - start_time(pickup) <=
t + pickup_to_delivery_absolute_detour_limit

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

Duration

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

string

Non-empty string specifying a "type" for this shipment. This feature can be used to define incompatibilities or requirements between shipment_types (see shipment_type_incompatibilities and shipment_type_requirements in ShipmentModel ).

Differs from visit_types which is specified for a single visit: All pickup/deliveries belonging to the same shipment share the same shipment_type .

label

string

Specifies a label for this shipment. This label is reported in the response in the shipment_label of the corresponding ShipmentRoute.Visit .

ignore

bool

If true, skip this shipment, but don't apply a penalty_cost .

Ignoring a shipment results in a validation error when there are any shipment_type_requirements in the model.

Ignoring a shipment that is performed in injected_first_solution_routes or injected_solution_constraint is permitted; the solver removes the related pickup/delivery visits from the performing route. precedence_rules that reference ignored shipments will also be ignored.

penalty_cost

double

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

double

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 pickup_to_delivery_relative_detour_limit enforces:

start_time(delivery) - start_time(pickup) <=
std::ceil(t * (1.0 + pickup_to_delivery_relative_detour_limit))

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

int64

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

LatLng

The geo-location where the vehicle arrives when performing this VisitRequest . If the shipment model has duration distance matrices, arrival_location must not be specified.

arrival_waypoint

Waypoint

The waypoint where the vehicle arrives when performing this VisitRequest . If the shipment model has duration distance matrices, arrival_waypoint must not be specified.

departure_location

LatLng

The geo-location where the vehicle departs after completing this VisitRequest . Can be omitted if it is the same as arrival_location . If the shipment model has duration distance matrices, departure_location must not be specified.

departure_waypoint

Waypoint

The waypoint where the vehicle departs after completing this VisitRequest . Can be omitted if it is the same as arrival_waypoint . If the shipment model has duration distance matrices, departure_waypoint must not be specified.

tags[]

string

Specifies tags attached to the visit request. Empty or duplicate strings are not allowed.

time_windows[]

TimeWindow

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 TimeWindow.start_time .

The absence of TimeWindow means that the vehicle can perform this visit at any time.

Time windows must be disjoint, ie no time window must overlap with or be adjacent to another, and they must be in increasing order.

cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

duration

Duration

Duration of the visit, ie time spent by the vehicle between arrival and departure (to be added to the possible waiting time; see time_windows ).

cost

double

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 Shipment.penalty_cost and must not be negative.

load_demands

map<string, Load >

Load demands of this visit request. This is just like Shipment.load_demands field, except that it only applies to this VisitRequest instead of the whole Shipment . The demands listed here are added to the demands listed in Shipment.load_demands .

visit_types[]

string

Specifies the types of the visit. This may be used to allocate additional time required for a vehicle to complete this visit (see Vehicle.extra_visit_duration_for_visit_type ).

A type can only appear once.

label

string

Specifies a label for this VisitRequest . This label is reported in the response as visit_label in the corresponding ShipmentRoute.Visit .

avoid_u_turns

bool

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[]

Shipment

Set of shipments which must be performed in the model.

vehicles[]

Vehicle

Set of vehicles which can be used to perform visits.

objectives[]

Objective

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 solving_mode = TRANSFORM_AND_RETURN_REQUEST. Note that the request will not be solved in this case. See corresponding documentation.

Experimental: See https://developers.google.com/maps/tt/route-optimization/experimental/objectives/make-request for more details.

global_start_time

Timestamp

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 global_end_time and the global_start_time must be within 31536000 seconds of each other.

When using cost_per_*hour fields, you might want to set this window to a smaller interval to increase performance (eg. if you model a single day, you should set the global time limits to that day). If unset, 00:00:00 UTC, January 1, 1970 (ie seconds: 0, nanos: 0) is used as default.

global_end_time

Timestamp

If unset, 00:00:00 UTC, January 1, 1971 (ie seconds: 31536000, nanos: 0) is used as default.

global_duration_cost_per_hour

double

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 Shipment.penalty_cost .

duration_distance_matrices[]

DurationDistanceMatrix

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 use_geodesic_distances field. If it is not empty, use_geodesic_distances cannot be true and neither duration_distance_matrix_src_tags nor duration_distance_matrix_dst_tags can be empty.

ব্যবহারের উদাহরণ:

  • There are two locations: locA and locB.
  • 1 vehicle starting its route at locA and ending it at locA.
  • 1 pickup visit request at locB.
model {
  vehicles { start_tags: "locA"  end_tags: "locA" }
  shipments { pickups { tags: "locB" } }
  duration_distance_matrix_src_tags: "locA"
  duration_distance_matrix_src_tags: "locB"
  duration_distance_matrix_dst_tags: "locA"
  duration_distance_matrix_dst_tags: "locB"
  duration_distance_matrices {
    rows {  # from: locA
      durations { seconds: 0 }   meters: 0    # to: locA
      durations { seconds: 100 } meters: 1000 # to: locB
    }
    rows {  # from: locB
      durations { seconds: 102 } meters: 990 # to: locA
      durations { seconds: 0 }   meters: 0   # to: locB
    }
  }
}
  • There are three locations: locA, locB and locC.
  • 1 vehicle starting its route at locA and ending it at locB, using matrix "fast".
  • 1 vehicle starting its route at locB and ending it at locB, using matrix "slow".
  • 1 vehicle starting its route at locB and ending it at locB, using matrix "fast".
  • 1 pickup visit request at locC.
model {
  vehicles { start_tags: "locA" end_tags: "locB" start_tags: "fast" }
  vehicles { start_tags: "locB" end_tags: "locB" start_tags: "slow" }
  vehicles { start_tags: "locB" end_tags: "locB" start_tags: "fast" }
  shipments { pickups { tags: "locC" } }
  duration_distance_matrix_src_tags: "locA"
  duration_distance_matrix_src_tags: "locB"
  duration_distance_matrix_src_tags: "locC"
  duration_distance_matrix_dst_tags: "locB"
  duration_distance_matrix_dst_tags: "locC"
  duration_distance_matrices {
    vehicle_start_tag: "fast"
    rows {  # from: locA
      durations { seconds: 1000 } meters: 2000 # to: locB
      durations { seconds: 600 }  meters: 1000 # to: locC
    }
    rows {  # from: locB
      durations { seconds: 0 }   meters: 0    # to: locB
      durations { seconds: 700 } meters: 1200 # to: locC
    }
    rows {  # from: locC
      durations { seconds: 702 } meters: 1190 # to: locB
      durations { seconds: 0 }   meters: 0    # to: locC
    }
  }
  duration_distance_matrices {
    vehicle_start_tag: "slow"
    rows {  # from: locA
      durations { seconds: 1800 } meters: 2001 # to: locB
      durations { seconds: 900 }  meters: 1002 # to: locC
    }
    rows {  # from: locB
      durations { seconds: 0 }    meters: 0    # to: locB
      durations { seconds: 1000 } meters: 1202 # to: locC
    }
    rows {  # from: locC
      durations { seconds: 1001 } meters: 1195 # to: locB
      durations { seconds: 0 }    meters: 0    # to: locC
    }
  }
}
duration_distance_matrix_src_tags[]

string

Tags defining the sources of the duration and distance matrices; duration_distance_matrices(i).rows(j) defines durations and distances from visits with tag duration_distance_matrix_src_tags(j) to other visits in matrix i.

Tags correspond to VisitRequest.tags or Vehicle.start_tags . A given VisitRequest or Vehicle must match exactly one tag in this field. Note that a Vehicle 's source, destination and matrix tags may be the same; similarly a VisitRequest 's source and destination tags may be the same. All tags must be different and cannot be empty strings. If this field is not empty, then duration_distance_matrices must not be empty.

duration_distance_matrix_dst_tags[]

string

Tags defining the destinations of the duration and distance matrices; duration_distance_matrices(i).rows(j).durations(k) (resp. duration_distance_matrices(i).rows(j).meters(k)) defines the duration (resp. the distance) of the travel from visits with tag duration_distance_matrix_src_tags(j) to visits with tag duration_distance_matrix_dst_tags(k) in matrix i.

Tags correspond to VisitRequest.tags or Vehicle.start_tags . A given VisitRequest or Vehicle must match exactly one tag in this field. Note that a Vehicle 's source, destination and matrix tags may be the same; similarly a VisitRequest 's source and destination tags may be the same. All tags must be different and cannot be empty strings. If this field is not empty, then duration_distance_matrices must not be empty.

transition_attributes[]

TransitionAttributes

Transition attributes added to the model.

shipment_type_incompatibilities[]

ShipmentTypeIncompatibility

Sets of incompatible shipment_types (see ShipmentTypeIncompatibility ).

shipment_type_requirements[]

ShipmentTypeRequirement

Sets of shipment_type requirements (see ShipmentTypeRequirement ).

precedence_rules[]

PrecedenceRule

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

int32

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[]

Row

Specifies the rows of the duration and distance matrix. It must have as many elements as ShipmentModel.duration_distance_matrix_src_tags .

vehicle_start_tag

string

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 start_tags field must match the vehicle_start_tag of a matrix (and of that matrix only).

All matrices must have a different vehicle_start_tag .

সারি

Specifies a row of the duration and distance matrix.

ক্ষেত্র
durations[]

Duration

Duration values for a given row. It must have as many elements as ShipmentModel.duration_distance_matrix_dst_tags .

meters[]

double

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 durations .

উদ্দেশ্য

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

Type

The type of the objective.

weight

double

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.

Enums
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

bool

Indicates if the "first" event is a delivery.

second_is_delivery

bool

Indicates if the "second" event is a delivery.

offset_duration

Duration

The offset between the "first" and "second" event. It can be negative.

first_index

int32

Shipment index of the "first" event. This field must be specified.

second_index

int32

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

int32

Vehicle performing the route, identified by its index in the source ShipmentModel .

vehicle_label

string

Label of the vehicle performing this route, equal to ShipmentModel.vehicles(vehicle_index).label , if specified.

vehicle_start_time

Timestamp

Time at which the vehicle starts its route.

vehicle_end_time

Timestamp

Time at which the vehicle finishes its route.

visits[]

Visit

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[]

Transition

Ordered list of transitions for the route.

has_traffic_infeasibilities

bool

When OptimizeToursRequest.consider_road_traffic , is set to true, this field indicates that inconsistencies in route timings are predicted using traffic-based travel duration estimates. There may be insufficient time to complete traffic-adjusted travel, delays, and breaks between visits, before the first visit, or after the last visit, while still satisfying the visit and vehicle time windows. For example,

  start_time(previous_visit) + duration(previous_visit) +
  travel_duration(previous_visit, next_visit) > start_time(next_visit)

Arrival at next_visit will likely happen later than its current time window due the increased estimate of travel time travel_duration(previous_visit, next_visit) due to traffic. Also, a break may be forced to overlap with a visit due to an increase in travel time estimates and visit or break time window restrictions.

route_polyline

EncodedPolyline

The encoded polyline representation of the route. This field is only populated if OptimizeToursRequest.populate_polylines is set to true.

breaks[]

Break

Breaks scheduled for the vehicle performing this route. The breaks sequence represents time intervals, each starting at the corresponding start_time and lasting duration seconds.

metrics

AggregatedMetrics

Duration, distance and load metrics for this route. The fields of AggregatedMetrics are summed over all ShipmentRoute.transitions or ShipmentRoute.visits , depending on the context.

vehicle_fullness

VehicleFullness

VehicleFullness field for computing how close the capped metrics are to their respective vehicle limits. Its fields are ratios between a capped metric field (eg AggregatedMetrics.travel_distance_meters ) and the related vehicle limit (eg Vehicle.route_distance_limit ).

Experimental: This field's behavior or existence may change in future.

route_costs

map<string, double>

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

double

Total cost of the route. The sum of all costs in the cost map.

বিরতি

Data representing the execution of a break.

ক্ষেত্র
start_time

Timestamp

Start time of a break.

duration

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

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

Duration

Travel duration during this transition.

travel_distance_meters

double

Distance traveled during the transition.

traffic_info_unavailable

bool

When traffic is requested via OptimizeToursRequest.consider_road_traffic , and the traffic info couldn't be retrieved for a Transition , this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).

delay_duration

Duration

Sum of the delay durations applied to this transition. If any, the delay starts exactly delay_duration seconds before the next event (visit or vehicle end). See TransitionAttributes.delay .

break_duration

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 ShipmentRoute.breaks .

wait_duration

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

Duration

Total duration of the transition, provided for convenience. It is equal to:

  • next visit start_time (or vehicle_end_time if this is the last transition) - this transition's start_time ;
  • if ShipmentRoute.has_traffic_infeasibilities is false, the following additionally holds: `total_duration = travel_duration + delay_duration
  • break_duration + wait_duration`.
start_time

Timestamp

Start time of this transition.

route_polyline

EncodedPolyline

The encoded polyline representation of the route followed during the transition. This field is only populated if populate_transition_polylines is set to true.

route_token

string

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 populate_transition_polylines is set to true.

vehicle_loads

map<string, VehicleLoad >

Vehicle loads during this transition, for each type that either appears in this vehicle's Vehicle.load_limits , or that have non-zero Shipment.load_demands on some shipment performed on this route.

The loads during the first transition are the starting loads of the vehicle route. Then, after each visit, the visit's load_demands are either added or subtracted to get the next transition's loads, depending on whether the visit was a pickup or a delivery.

VehicleLoad

Reports the actual load of the vehicle at some point along the route, for a given type (see Transition.vehicle_loads ).

ক্ষেত্র
amount

int64

The amount of load on the vehicle, for the given type. The unit of load is usually indicated by the type. See Transition.vehicle_loads .

যান

A visit performed during a route. This visit corresponds to a pickup or a delivery of a Shipment .

ক্ষেত্র
shipment_index

int32

Index of the shipments field in the source ShipmentModel .

is_pickup

bool

If true the visit corresponds to a pickup of a Shipment . Otherwise, it corresponds to a delivery.

visit_request_index

int32

Index of VisitRequest in either the pickup or delivery field of the Shipment (see is_pickup ).

start_time

Timestamp

Time at which the visit starts. Note that the vehicle may arrive earlier than this at the visit location. Times are consistent with the ShipmentModel .

load_demands

map<string, Load >

Total visit load demand as the sum of the shipment and the visit request load_demands . The values are negative if the visit is a delivery. Demands are reported for the same types as the Transition.loads (see this field).

detour

Duration

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:

start_time(delivery) - start_time(pickup)
- (duration(pickup) + travel duration from the pickup location
to the delivery location).

Otherwise, it is computed from the vehicle start_location and is equal to:

start_time - vehicle_start_time - travel duration from
the vehicle's `start_location` to the visit.
shipment_label

string

Copy of the corresponding Shipment.label , if specified in the Shipment .

visit_label

string

Copy of the corresponding VisitRequest.label , if specified in the VisitRequest .

injected_solution_location_token

int32

An opaque token representing information about a visit location.

This field may be populated in the result routes' visits when VisitRequest.avoid_u_turns was set to true for this visit or if ShipmentModel.avoid_u_turns was set to true in the request OptimizeToursRequest .

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[]

string

List of incompatible types. Two shipments having different shipment_types among those listed are "incompatible".

incompatibility_mode

IncompatibilityMode

Mode applied to the incompatibility.

IncompatibilityMode

Modes defining how the appearance of incompatible shipments are restricted on the same route.

Enums
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:

  • They can share the same vehicle only if one is delivered before the other is picked up.
  • When both shipments are pickups-only (no deliveries) or deliveries-only (no pickups), they can't share the same vehicle at all.

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[]

string

List of alternative shipment types required by the dependent_shipment_types .

dependent_shipment_types[]

string

All shipments with a type in the dependent_shipment_types field require at least one shipment of type required_shipment_type_alternatives to be visited on the same route.

NOTE: Chains of requirements such that a shipment_type depends on itself are not allowed.

requirement_mode

RequirementMode

Mode applied to the requirement.

RequirementMode

Modes defining the appearance of dependent shipments on a route.

Enums
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 IN_SAME_VEHICLE_AT_PICKUP_TIME mode, all "dependent" shipments need to have at least one "required" shipment on their vehicle at the time of their pickup.

A "dependent" shipment pickup must therefore have either:

  • A delivery-only "required" shipment delivered on the route after, or
  • A "required" shipment picked up on the route before it, and if the "required" shipment has a delivery, this delivery must be performed after the "dependent" shipment's pickup.
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

int32

The index corresponds to the index of the shipment in the source ShipmentModel .

label

string

Copy of the corresponding Shipment.label , if specified in the Shipment .

reasons[]

Reason

A list of reasons that explain why the shipment was skipped. See comment above Reason . If we are unable to understand why a shipment was skipped, reasons will not be set.

penalty_cost

double

This is a copy of the Shipment.penalty_cost , included here to make it easier to see the severity of a skipped shipment.

Experimental: This field's behavior or existence may change in future.

estimated_incompatible_vehicle_ratio

double

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

Code

Refer to the comments of Code.

example_vehicle_indices[]

int32

Same as example_vehicle_index except that we provide the list of multiple identified vehicles. This list is not necessarily exhaustive. This is only filled if [fill_example_vehicle_indices_in_skipped_reasons][] is true.

Experimental: This field's behavior or existence may change in future.

example_exceeded_capacity_type

string

If the reason code is DEMAND_EXCEEDS_VEHICLE_CAPACITY , documents one capacity type that is exceeded.

example_vehicle_index

int32

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.

Enums
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 start_location to the shipment's pickup and/or delivery locations and to the vehicle's end location exceeds the vehicle's route_distance_limit .

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 route_duration_limit .

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 ignore field is true.

Experimental: This field's behavior or existence may change in future.

SHIPMENT_IGNORED

The shipment's ignore field is true.

Experimental: This field's behavior or existence may change in future.

SKIPPED_IN_INJECTED_SOLUTION_CONSTRAINT

The shipment is skipped in the injected_solution_constraint .

Experimental: This field's behavior or existence may change in future.

VEHICLE_ROUTE_IS_FULLY_SEQUENCE_CONSTRAINED

The vehicle route relaxation specified in the injected_solution_constraint doesn't permit any visit to be inserted.

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

Timestamp

The hard time window start time. If unspecified it will be set to ShipmentModel.global_start_time .

end_time

Timestamp

The hard time window end time. If unspecified it will be set to ShipmentModel.global_end_time .

soft_start_time

Timestamp

The soft start time of the time window.

soft_end_time

Timestamp

The soft end time of the time window.

cost_per_hour_before_soft_start_time

double

A cost per hour added to other costs in the model if the event occurs before soft_start_time, computed as:

   max(0, soft_start_time - t.seconds)
                          * cost_per_hour_before_soft_start_time / 3600,
t being the time of the event.

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

double

A cost per hour added to other costs in the model if the event occurs after soft_end_time , computed as:

   max(0, t.seconds - soft_end_time.seconds)
                    * cost_per_hour_after_soft_end_time / 3600,
t being the time of the event.

This cost must be positive, and the field can only be set if soft_end_time has been set.

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

string

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

A source visit or vehicle start matches iff its VisitRequest.tags or Vehicle.start_tags 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 or Vehicle.end_tags 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

double

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

double

Specifies a cost per kilometer applied to the distance traveled while performing this transition. It adds up to any Vehicle.cost_per_kilometer specified on vehicles.

distance_limit

DistanceLimit

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

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

delay

Duration

Specifies a delay incurred when performing this transition.

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

Uri

A Universal Resource Identifier that points to a resource that can be read and written by the Route Optimization API.

ক্ষেত্র
uri

string

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 .json . If the resource is encoded as textproto, the resource name must be suffixed with .txtpb . For example, a Google Cloud Storage URI to a JSON encoded file might look like: gs://bucket/path/input/object.json .

যানবাহন

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

string

The user-defined display name of the vehicle. It can be up to 63 characters long and may use UTF-8 characters.

travel_mode

TravelMode

The travel mode which affects the roads usable by the vehicle and its speed. See also travel_duration_multiple .

route_modifiers

RouteModifiers

A set of conditions to satisfy that affect the way routes are calculated for the given vehicle.

start_location

LatLng

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_location must not be specified.

start_waypoint

Waypoint

Waypoint representing a geographic location where the vehicle starts before picking up any shipments. If neither start_waypoint nor start_location is specified, the vehicle starts at its first pickup. If the shipment model has duration and distance matrices, start_waypoint must not be specified.

end_location

LatLng

Geographic location where the vehicle ends after it has completed its last VisitRequest . If not specified the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest . If the shipment model has duration and distance matrices, end_location must not be specified.

end_waypoint

Waypoint

Waypoint representing a geographic location where the vehicle ends after it has completed its last VisitRequest . If neither end_waypoint nor end_location is specified, the vehicle's ShipmentRoute ends immediately when it completes its last VisitRequest . If the shipment model has duration and distance matrices, end_waypoint must not be specified.

start_tags[]

string

Specifies tags attached to the start of the vehicle's route.

Empty or duplicate strings are not allowed.

end_tags[]

string

Specifies tags attached to the end of the vehicle's route.

Empty or duplicate strings are not allowed.

start_time_windows[]

TimeWindow

Time windows during which the vehicle may depart its start location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits.

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.

cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

end_time_windows[]

TimeWindow

Time windows during which the vehicle may arrive at its end location. They must be within the global time limits (see ShipmentModel.global_* fields). If unspecified, there is no limitation besides those global time limits.

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.

cost_per_hour_after_soft_end_time and soft_end_time can only be set if there is a single time window.

unloading_policy

UnloadingPolicy

Unloading policy enforced on the vehicle.

load_limits

map<string, LoadLimit >

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 Shipment.load_demands field. If a given key is absent from this map, the corresponding capacity is considered to be limitless.

cost_per_hour

double

Vehicle costs: all costs add up and must be in the same unit as Shipment.penalty_cost .

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_hour instead of just cost_per_traveled_hour may result in additional latency.

cost_per_traveled_hour

double

Cost per traveled hour of the vehicle route. This cost is applied only to travel time taken by the route (ie, that reported in ShipmentRoute.transitions ), and excludes waiting time and visit time.

cost_per_kilometer

double

Cost per kilometer of the vehicle route. This cost is applied to the distance reported in the ShipmentRoute.transitions and does not apply to any distance implicitly traveled from the arrival_location to the departure_location of a single VisitRequest .

fixed_cost

double

Fixed cost applied if this vehicle is used to handle a shipment.

used_if_route_is_empty

bool

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 break_rule or delay (from TransitionAttributes ) are scheduled for this vehicle. In this case, the vehicle's ShipmentRoute doesn't contain any information except for the vehicle index and label.

route_duration_limit

DurationLimit

Limit applied to the total duration of the vehicle's route. In a given OptimizeToursResponse , the route duration of a vehicle is the difference between its vehicle_end_time and vehicle_start_time .

travel_duration_limit

DurationLimit

Limit applied to the travel duration of the vehicle's route. In a given OptimizeToursResponse , the route travel duration is the sum of all its transitions.travel_duration .

route_distance_limit

DistanceLimit

Limit applied to the total distance of the vehicle's route. In a given OptimizeToursResponse , the route distance is the sum of all its transitions.travel_distance_meters .

extra_visit_duration_for_visit_type

map<string, Duration >

Specifies a map from visit_types strings to durations. The duration is time in addition to VisitRequest.duration to be taken at visits with the specified visit_types . This extra visit duration adds cost if cost_per_hour is specified. Keys (ie visit_types ) cannot be empty strings.

If a visit request has multiple types, a duration will be added for each type in the map.

break_rule

BreakRule

Describes the break schedule to be enforced on this vehicle. If empty, no breaks will be scheduled for this vehicle.

label

string

Specifies a label for this vehicle. This label is reported in the response as the vehicle_label of the corresponding ShipmentRoute .

ignore

bool

If true, used_if_route_is_empty must be false, and this vehicle will remain unused.

If a shipment is performed by an ignored vehicle in injected_first_solution_routes , it is skipped in the first solution but is free to be performed in the response.

If a shipment is performed by an ignored vehicle in injected_solution_constraint and any related pickup/delivery is constrained to remain on the vehicle (ie, not relaxed to level RELAX_ALL_AFTER_THRESHOLD ), it is skipped in the response. If a shipment has a non-empty allowed_vehicle_indices field and all of the allowed vehicles are ignored, it is skipped in the response.

travel_duration_multiple

double

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 cost_per_hour or cost_per_traveled_hour are specified. This must be in the range [0.001, 1000.0]. If unset, the vehicle is standard, and this multiple is considered 1.0.

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 extra_visit_duration_for_visit_type below.

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

Duration

A hard limit constraining the duration to be at most max_duration.

soft_max_duration

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, soft_max_duration must be nonnegative. If max_duration is also defined, soft_max_duration must be less than max_duration.

quadratic_soft_max_duration

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, quadratic_soft_max_duration must be nonnegative. If max_duration is also defined, quadratic_soft_max_duration must be less than max_duration , and the difference must be no larger than one day:

max_duration - quadratic_soft_max_duration <= 86400 seconds

cost_per_hour_after_soft_max

double

Cost per hour incurred if the soft_max_duration threshold is violated. The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows:

  cost_per_hour_after_soft_max * (duration - soft_max_duration)

The cost must be nonnegative.

cost_per_square_hour_after_quadratic_soft_max

double

Cost per square hour incurred if the quadratic_soft_max_duration threshold is violated.

The additional cost is 0 if the duration is under the threshold, otherwise the cost depends on the duration as follows:

  cost_per_square_hour_after_quadratic_soft_max *
  (duration - quadratic_soft_max_duration)^2

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

int64

A soft limit of the load. See cost_per_unit_above_soft_max .

cost_per_unit_above_soft_max

double

If the load ever exceeds soft_max_load along this vehicle's route, the following cost penalty applies (only once per vehicle): (load - soft_max_load ) * cost_per_unit_above_soft_max . All costs add up and must be in the same unit as Shipment.penalty_cost . Soft limits may only be defined on types that apply to either pickups only or deliveries only throughout the model.

start_load_interval

Interval

The acceptable load interval of the vehicle at the start of the route.

end_load_interval

Interval

The acceptable load interval of the vehicle at the end of the route.

max_load

int64

The maximum acceptable amount of load.

cost_per_kilometer

LoadCost

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

LoadCost

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

int64

A minimum acceptable load. Must be ≥ 0. If they're both specified, min must be ≤ max .

max

int64

A maximum acceptable load. Must be ≥ 0. If unspecified, the maximum load is unrestricted by this message. If they're both specified, min must be ≤ max .

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

int64

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

double

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

double

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.

Enums
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 .

Enums
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

double

Maximum of all other fields in this message.

distance

double

The ratio between AggregatedMetrics.travel_distance_meters and Vehicle.route_distance_limit . If Vehicle.route_distance_limit is unset, this field will be unset.

travel_duration

double

The ratio between [AggregatedMetrics.travel_duration_seconds][] and Vehicle.travel_duration_limit . If Vehicle.travel_duration_limit is unset, this field will be unset.

active_duration

double

The ratio between [AggregatedMetrics.total_duration_seconds][] and Vehicle.route_duration_limit . If Vehicle.route_duration_limit is unset, this field will be unset.

max_load

double

The maximum ratio among all types of [AggregatedMetrics.max_load][] and their respective Vehicle.load_limits . If all Vehicle.load_limits fields are unset, this field will be unset.

active_span

double

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 ( ShipmentModel.global_end_time - ShipmentModel.global_start_time ) instead.

Waypoint

Encapsulates a waypoint. Waypoints mark arrival and departure locations of VisitRequests, and start and end locations of Vehicles.

ক্ষেত্র
side_of_road

bool

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

bool

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

Location

A point specified using geographic coordinates, including an optional heading.

place_id

string

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.