Different times for motorcycles and cars

I have a problem routes, i use motorcycles and cars, also have the matrix of distance and time between services, but times by car is different times on motorcycles, I can use some constraint or precedure ?, or should first processing motorcycles and then process cars with the other services, each with its matrix of times and distances (but is double processing)
thanks

Hi @dante_fuster,

If I understand your requirement correctly you need Vehicle Dependent Transportation times.

For this you need to modify VehicleRoutingTransportCostsMatrix .

Modify this as to make transportation time vehicle dependent : i.e. :
getTime(String fromId, String toId, Vehicle vehicle)

And modify this to add vehicle dependent traonsportation time. i.e:
addTransportTime(String from, String to, double time, Vehicle vehicle)

Hi Bhoumik_Shah
Thanks , if I have 100 vehicles should I use the time matrix for all vehicles? its posissible use vehicletype? or vehicle name for example “car” or “moto”:

addTransportTime(String from, String to, double time, String Name)

getTime(String fromId, String toId, String Name)

where I can use getTime to change the calculation times for the vehicles when are evaluating routes and jobs? (solutions)

Hi @dante_fuster,

You can use vehicleType also.

Thanks very much
a last question?
where I can use the funvtion:
getTime (String fromId, String toId, String Name)

to change the calculation times for the vehicles when are evaluating routes and jobs in the iteration?

1 Like

@dante_fuster,

I don’t know all the class where getTime is used. So won’t be able to help you.

If I were at your position I would run my code in debug mode with a break point on original getTime method to find out.

probably related:

Hello
Thanks very much, is very util, i have 1000 service and 80 vehicle (cars, motorcicles)
their guidance will help me a lot to solve the problem, I’m working on two solutions, one executed in Java and other OpenJUMP executed for viewing, I have to evaluate that much memory is not consumed
Thank you