• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

date and time methods for reservations

 
Ranch Hand
Posts: 90
Java ME MySQL Database PHP
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a limo service that will take call ins and allow you to make reservations, but I'm having a problem. I want to make sure i don't have the driver scheduled for two different pickups at the same time on the same date. I don't wont them driving unless there has been an hour of down time since their last pickup. I also need to make sure it is kept up with for future reservations, so a log of some kind. For instance, if a driver has a pickup now and then again in an hour then that's fine because it will be a hour in between, but if there is a reservation for 6 months out, is he going to be available, or will it hit during his 'down time' making it necessary to get a different driver.
 
Greenhorn
Posts: 27
1
IBM DB2 Netbeans IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem seems ideal for the Greedy Task Scheduling algorithm.
Input: A set T of tasks, where each task has a start time and a finish time.
Output: A non-conflicting schedule of task in T using the minimum number of drivers.

d = 0; //optimum number of drivers
while T != 0
  remove from set of tasks T the task i with the smallest start time
  if there is a driver d with no task conflicting with task i
      schedule task with driver
  else
      d = d + 1 //find driver
      schedule task with new driver
 
Hold that thought. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic