When vehicles have a time window, we rely on a lower bound of accumulated service time for compatible jobs to derive an upper bound of the number of tasks that can be served by the vehicle:
|
const auto vehicle_duration = vehicle.available_duration(); |
|
std::size_t doable_tasks = 0; |
|
Duration time_sum = 0; |
|
|
|
for (std::size_t j = 0; j < jobs.size(); ++j) { |
|
if (time_sum > vehicle_duration) { |
|
break; |
|
} |
|
if (vehicle_ok_with_job(v, job_times[j].rank)) { |
|
++doable_tasks; |
|
time_sum += job_times[j].action; |
|
} |
|
} |
|
|
|
vehicle.max_tasks = std::min(vehicle.max_tasks, doable_tasks); |
The way it's currently done is too loose. For example if a vehicle has a TW with length 1000 and all jobs have a service of 100, then the max_tasks value we get is 11 where it should really be only 10.
When vehicles have a time window, we rely on a lower bound of accumulated service time for compatible jobs to derive an upper bound of the number of tasks that can be served by the vehicle:
vroom/src/structures/vroom/input/input.cpp
Lines 724 to 738 in 7025670
The way it's currently done is too loose. For example if a vehicle has a TW with length 1000 and all jobs have a service of 100, then the
max_tasksvalue we get is 11 where it should really be only 10.