VROOM-Project / pyvroom

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

Missing coordinates for routing engine #78

Closed fahadahaf closed 1 year ago

fahadahaf commented 1 year ago

Hi, I am trying to replicate the example given in pyvroom readme, but getting the following error:

---------------------------------------------------------------------------
VroomInputException                       Traceback (most recent call last)
<ipython-input-12-24e85c7bac87> in <module>
----> 1 solution = problem_instance.solve(exploration_level=5, nb_threads=4)

~/.local/lib/python3.8/site-packages/vroom/input/input.py in solve(self, exploration_level, nb_threads)
    310     ) -> Solution:
    311         return Solution(
--> 312             self._solve(
    313                 exploration_level=exploration_level,
    314                 nb_threads=nb_threads,

VroomInputException: Missing coordinates for routing engine.

I get this when running the following: solution = problem_instance.solve(exploration_level=5, nb_threads=4)

jonathf commented 1 year ago

Sounds like some of the lines from the example hasn't registered.

Mind posting version info about your platform, OS, python and vroom?

fahadahaf commented 1 year ago

Here are the details: pyvroom: 1.13.1 OS: MacOS Monterey (12.5) python: 3.8.5

jonathf commented 1 year ago

Not reproducing the issue.

Just so we don't miss anything, can you confirm that this is the code that fails:

import vroom

problem_instance = vroom.Input()
problem_instance.set_durations_matrix(
    profile="car",
    matrix_input=[[0, 2104, 197, 1299],
                  [2103, 0, 2255, 3152],
                  [197, 2256, 0, 1102],
                  [1299, 3153, 1102, 0]],
)
problem_instance.add_vehicle([vroom.Vehicle(47, start=0, end=0),
                              vroom.Vehicle(48, start=2, end=2)])
problem_instance.add_job([vroom.Job(1414, location=0),
                          vroom.Job(1515, location=1),
                          vroom.Job(1616, location=2),
                          vroom.Job(1717, location=3)])
solution = problem_instance.solve(exploration_level=5, nb_threads=4)
fahadahaf commented 1 year ago

It works now, my mistake was I was using "vehicle" as profile and not "car". Thank you.