Skip to content

[Help] MDVRP with WorkingTime TimeWindows, but DrivingTime Break #1652

@kd509

Description

@kd509

Hello,

I started with or-tools some days ago in C# and have a problem now with breaks. Maybe somebody can help me.

I try to solve a routing problem (MDVRP with TimeWindows and Capacity). The TimeWindows are based on working time, which means driving time + service time. So far so good.

What I try to implement now, is a break based on driving time only. So the driver of a vehicle can use the vehicle about 6 hours, but after a maximum of 4.5 hours of driving (!) he needs a break of 45 minutes.

I create the break per vehicle in the following way:

IntervalVarVector breaks = new IntervalVarVector();
IntervalVar breakInterval = solver.MakeFixedDurationIntervalVar(theBreak.timeWindow.Start, theBreak.timeWindow.End, theBreak.Duration, false, $"Break_{b}_{vehicle.Id}");
RoutingDimension rdDrivingTime = routing.GetMutableDimension("drivingTime");
breaks.Add(breakInterval);
rdDrivingTime.SetBreakIntervalsOfVehicle(breaks, i, node_visit_transits);

But how to tell the dimension "workingTime", to insert a break at the correct time, because my break bases on drivingTime?

Regards

Karsten

Metadata

Metadata

Assignees

Labels

Help NeededModeling/Usage problemLang: .NET.Net wrapper issueSolver: RoutingUses the Routing library and the original CP solverSolver: Routing - breakRouting break related issue

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions