PDA

View Full Version : Lunches



Doc203
06-04-2012, 10:33 PM
I am trying to program lunch stops via VBA and the only way I have found to do it is via the "rest stop" method. I would like to be able to set the exact time and length someone might take a lunch, but cannot do so by adding a stop because the stops are dynamic every day. The problem with using automated rest stops is time spent at each stop is not accounted for, therefor the rest stop is based upon driving time only and can be very random. Anyone have any ideas?

Thanks,

Jim

Eric Frost
06-05-2012, 08:46 AM
Can they always take a break right AFTER a delivery and not somewhere along a route?

I guess the first way I'd try to approach this is to set up the route and calculate, then loop over the stops and find the first one say after 12 NOON. It might be 12:05 or 12:45 or whatever. Then add a STOPTIME to that stop with the lunch time, whatever it is, say 1 hour.

Does that make sense?

Eric

Doc203
06-05-2012, 10:13 AM
Yes that makes perfect sense Eric - exactly what I was looking for.

Thanks,

Jim

Eric Frost
06-05-2012, 10:41 AM
Maybe you can find the first stop after 12 Noon, and then also check the previous one to see which is closer to 12 Noon.

In case for instance you have one stop at 11:55 AM and the next is not until 1:15 PM for instance.

Let us know if you get stuck and maybe you can post a sample Excel file and we can help work it out.

Eric