VROOM-Project / pyvroom

Vehicle Routing Open-source Optimization Machine
BSD 2-Clause "Simplified" License
67 stars 14 forks source link

VroomInputException: Invalid profile: car. #88

Closed L0G1C06 closed 1 year ago

L0G1C06 commented 1 year ago

The lib is not recognizing the car profile, but this profile exist on VROOM

nilsnolde commented 1 year ago

Can you outline a bit more your steps? Input/minimal code & the error (copy/paste, pls no screenshots). My guess is you’re not having any OSRM graph loaded and you’re not providing a custom matrix?

L0G1C06 commented 1 year ago

The code where i define the profile is the next:

problem_instance.add_vehicle([vroom.Vehicle(vehicle['id'], start=[start_lat, start_lng], end=[end_lat, end_lng], profile="car")])

I am not passing any custom matrix because I am using a JSON file that contains the addresses of all the points, with their respective longitudes and latitudes.

L0G1C06 commented 1 year ago

This is the form of the JSON file

{ "jobs": [ { "id": 1, "description": "Rue des Binelles, Sèvres", "location": [ 2.214431762695313, 48.82359296752074 ] }, { "id": 2, "description": "Quai Henri Pourchasse, Ivry-sur-Seine", "location": [ 2.4087524414062504, 48.813194201165274 ] }, { "id": 3, "description": "51, Allée Jules Guesde, Les Pavillons-sous-Bois", "location": [ 2.497329711914063, 48.89948375541988 ] }, { "id": 4, "description": "Rue La Boétie, Paris", "location": [ 2.309188842773438, 48.87239311228893 ] } ], "shipments": [], "vehicles": [ { "id": 1, "start": [ 2.2384643554687504, 48.93242424920101 ], "startDescription": "Quai de Bezons, Argenteuil", "end": [ 2.2384643554687504, 48.93242424920101 ], "endDescription": "Quai de Bezons, Argenteuil" } ], "options": { "g": true, } }

nilsnolde commented 1 year ago

Ok, but somewhere the routes have to come from. VROOM is a pure optimizer, it doesn’t do routing. So either you hook up a routing engine, or you provide a custom matrix.

L0G1C06 commented 1 year ago

I am running OSRM frontend docker and i pass instance = vroom.Input(servers={"osrm":"172.17.0.4:9966"}) on my code, is it a routing engine?

nilsnolde commented 1 year ago

I meant to copy/paste all relevant code. How you define the Input is very important. And wrong in this case: vroom.Input(servers={"car":"172.17.0.4:9966"}). See the PR for more details: https://github.com/VROOM-Project/pyvroom/pull/90/files.

nilsnolde commented 1 year ago

I assume this can be closed?