• Post Reply Bookmark Topic Watch Topic
  • New Topic

date and time methods for reservations  RSS feed

 
Daniel Stallard
Ranch Hand
Posts: 89
Java ME MySQL Database PHP
  • Mark post as helpful
  • send pies
  • 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.
 
Michael Billiot
Greenhorn
Posts: 3
Chrome IBM DB2 Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!