vlarmet / cppRouting

Algorithms for Routing and Solving the Traffic Assignment Problem
109 stars 9 forks source link

Compiling and Debugging cppRouting's NBA Function for Algorithm Analysis #25

Closed cheeminwoo closed 3 months ago

cheeminwoo commented 3 months ago

I'm writing because I have a question about using cppRouting. When I enter the command trajet <- get_path_pair(graph,from="32",to="6",algorithm="NBA"), I assume that the pathPair::nba() function in path_pair.cpp is called. Is this correct? I'm trying to study how the algorithm works by adding code to pathPair::nba() in path_pair.cpp to print arguments to a txt file. After modifying path_pair.cpp, I tried running the command trajet <- get_path_pair(graph,from="32",to="6",algorithm="NBA"), but no txt file was created. I think I need to compile it, but I'm new to R packages (and RStudio as well), so I'm wondering if there's a way to compile it or set a breakpoint to see how the code executes line by line. Thank you.

vlarmet commented 3 months ago

Hi, First you have to fork or clone the repository on your local machine.
I'm not using debugger for C++ code, so you can use I/O techniques.
You have to compile source code each time you modify it, you have two options :

On Windows, you have to install Rtools.