This program uses A* search algorithm to find path between start and end coordinates entered by the user. It is first project of C++ Udacity Nanodegree Program. It focuses on foundational topics like classes, list, pointers and references.
When cloning this project, be sure to use the --recurse-submodules
flag. Using HTTPS:
git clone https://github.com/adityakrmaurya/Route-Planning.git --recurse-submodules
or with SSH:
git clone git@github.com:adityakrmaurya/Route-Planning.git --recurse-submodules
- cmake >= 3.11.3
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 7.4.0
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same instructions as make - install Xcode command line tools
- Windows: recommend using MinGW
- IO2D
- Installation instructions for all operating systems can be found here
- Note: Make sure to run
sudo make install
at the end of setup - This library must be built in a place where CMake
find_package
will be able to find it
To compile the project, first, create a build
directory and change to that directory:
mkdir build && cd build
From within the build
directory, then run cmake
and make
as follows:
cmake ..
make
The executables will be placed in the bin
directory. From within build
, you can run the project as follows:
../bin/<name-of-parent-directory> -f ../map.osm
For exercises that have unit tests, the project must be built with the approprate test cpp file. This can be done by passing a string with the -DTESTING
flag in cmake
. For example, from the build directory:
cmake -DTESTING="RouteModel" ..
make
Those commands will build the code with the tests for the "Fill Out Route Model" exercise. The tests can then be run from the build
directory as follows:
../bin/test
Exercises with tests will specify which string to pass with -DTESTING
, but a table is given below with the complete list for reference:
Exercise Name | -DTESTING String Value |
---|---|
Fill Out Route Model | "RouteModel" |
Fill Out Node Class | "RMNodeClass" |
Create RouteModel Nodes | "RMSNodes" |
Write the Distance Function | "NodeDist" |
Create Road to Node Hashmap | "NodeToRoad" |
Write FindNeighbors | "FindNeighbors" |
Find the Closest Node | "FindClosest" |
Write the A* Search Stub | "AStarStub" |
Finish A* Search | "AStarSearch" |
Output-img.png |
---|