Planning tours for an entire week

Questions refering to the Optiflow based API within PTV Developer (launched on 20.12.2023)
Post Reply
unheal1337
Posts: 5
Joined: Fri Feb 23, 2024 1:51 pm

Planning tours for an entire week

Post by unheal1337 »

Hi there,

Is OptiFlow able to plan for many days?
Given the scenario to plan tours for an entire week, I am wondering if and how OptiFlow deals with it.

I imagine things that need to be taken into account are:
  • TimeSlots: Many time slots (1 per day) for a single location?
  • Orders: Date of the order (repeatedly daily tasks)
  • Calculated route on each vehicle: Does OptiFlow still returns a single route per vehicle? Does the route include all orders of the week plan
Has somebody already faced that scenario?

EDIT: I have tested a scenario based on the documentation with some modifications.
Notice that the arrival date at stop 3 is 01.01 and the departure date is 02.01. This means OptiFlow assumes that the vehicle will stay at stop 3 for 1 day

This is the outcome:

START: HAMBURG_PORT
END: HAMBURG_PORT
Stop Start End Arrival Departure
1 HAMBURG_PORT BIRDS_PICKUP 01.01.23 05:19 01.01.23 06:12
2 BIRDS_PICKUP WELTVOGELPARK_WALSRODE 01.01.23 07:32 01.01.23 08:10
3 WELTVOGELPARK_WALSRODE MAMMALS_PICKUP 01.01.23 09:38 02.01.23 11:20
4 MAMMALS_PICKUP WILDPARK_LUENEBURGER_HEIDE 02.01.23 11:58 02.01.23 12:28
Is it possible to define a daily driving limit?

Best
Tobi
manuel.streicher
Posts: 1
Joined: Thu Jun 06, 2024 8:12 am

Re: Planning tours for an entire week

Post by manuel.streicher »

Hi Tobi,

as you found out by now it is possible to plan multiple days to some extend. There is generally two possibilities to achieve what you are looking for.
  • Approach 1: One long tour including (internal/external) overnight stays: For each vehicle create a single vehicle with earliest start beginning of the week and latest end as the end of the week. This way optiflow will return the result as a single route per vehicle. However, as you saw yourself, this means that the driver will stop at any order that is convenient for the night. In some cases this can be handled by introducing dummy orders at the depot at the end of the workday. If you want to explore this possibility further, let me know, I can go into more details about it. A daily driving limit, in this case, can only be applied by providing a break rule that restricts the maximum driving time and has a high break duration, e.g. 8 hours.
  • Approach 2: Daily Roundtrips: create a vehicle object for every real vehicle and every day of the week to be planned. This time set earliest start and end according to the working hours on this particular day. In this approach, the result will return a route for each day of the week. Also the vehicle will return to its end location every day. Maximum duration of the daily tour can then be configured using vehicle.constraints.route.maximumDuration. To additionally limit the driving time, again breaks would have to be used in a similar fashion as above.
It really depends on the exact use case which option is preferrable. If more details are needed for one or both of the approaches, let me know.

Best,
Manuel Streicher
User avatar
Bernd Welter
Site Admin
Posts: 2822
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Planning tours for an entire week

Post by Bernd Welter »

just some samples...
Approach 1Approach 2
1 vehicle breaks.png
1 vehicle 5 days.png
One "long" interval interrupted by breaks given by maximum periods ("maximum driving duration", "maximumWorkingDurarion", "minimum break duration")Cloned vehicles per day. The transition from one "day" to another one is a change from one vehicle to another one. Therefore there's no "event" for the switch from one day to another one.
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
unheal1337
Posts: 5
Joined: Fri Feb 23, 2024 1:51 pm

Re: Planning tours for an entire week

Post by unheal1337 »

Thank you very much. These are good solutions that should work for our cases. I will keep you updated when testing it out.
User avatar
Bernd Welter
Site Admin
Posts: 2822
Joined: Mon Apr 14, 2014 10:28 am
Contact:

Re: Planning tours for an entire week

Post by Bernd Welter »

I've just been asked whether the timeslots have to be multiplied for the customers / locations in the same way as we did it with the vehicles..
The answer is : "nope - for the locations you can simply define an array of timeslots."

And even better: you can define additional properties per timeslot:
  • maximumAppointments : Describes how many appointments may be assigned to this time slot. When omitted, an unlimited number of appointments may be assigned to this time slot. (use this to manage the ramp's capacity in terms of "number of vehicles that can be served at the same time(slot))
  • costPerAppointment : Describes the cost for assigning an appointment to this time slot. (use this to define "preferences")
  • preparationDuration : Describes how long (seconds) it takes before the first task can be executed after starting the appointment.
    This chart shows the timeslots of several locations (one line per location). I decided to give a timeslot a red border if one of these additional attributes is set.
    This chart shows the timeslots of several locations (one line per location). I decided to give a timeslot a red border if one of these additional attributes is set.
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply