Package delivery service with schedules and time windows

Hi, I’m developing an app for a school project that handles vehicle routing. The app allows customers to create create a shipment with a (pickup, delivery) location, and date.

Drivers on the other hand can work in three different ways:

  • Strict Schedule (Weekdays from 9 to 5)
  • Loose schedule (Tomorrow from 8pm to 1am)
  • On the go (While app is opened)

My questions are:

  • How do I link dates (day, and time) to a time window since time 0 is considered to be the start of the algorithm and not the year 1970 as timestamps do. Do I delta out the timestamp against the current date? All examples I have found are based on routes for the same day.

  • Is it possible to create routes not knowing a driver’s location, just the jobs location? This is because if I wish to book a delivery:

If the schedule is known, I know that the driver will be available at a certain time but not where. Unless there is a way to tell the algorithm that the driver’s starting location will be on the generated route’s first pickup location.

Thanks for any help

You can transform your date in seconds and use it directly (see for example this discussion).

Does the suggestion from Phil help you?

Yes, thank you very much Stefan.