One needs [python3](https://www.python.org/downloads/) and [anaconda](https://www.anaconda.com/products/distribution) before initialising the environment.
<ins>/route</ins> gets as input a routing request consisting of start and end node, forbidden weather conditions and the period of time the search should take place. It returns a list of coordinates of the found path, as well as the duration, distance, the day of the route and an error code.
In order to initialise the environment, use from the `debug-tool` folder :
<ins>/addressmatching</ins> converts a given address to its coordinates. It returns the coordinate pair and an error code. For the address matching we are using Nominatim API to get the OSM data.
```sh
conda env create -f environment.yml
```
#### Description of steps to find the shortest path
The environment is called `swp_debug_tool` by default. You can activate it via the standard command `conda activate swp_debug_tool`.
- Nodes and Edges of our road network are added to a directed Graph
When adding dependencies, execute :
- if the street/edge is no oneway street the opposite edge is added as well
- the weight of the edges correspond to the duration of passing the edge
The `--from-history` parameter prevents adding the build ID to the dependency, as that is usually OS-specific. Also, it only
adds the dependencies explicitly installed by the user. Their dependencies are then resolved automatically. If you somehow
still have build IDs (i.e. your dependencies have the form `<name>=<version>=<build gibberish`)
, you can use the following regex find-replace in the YAML file, in order to remove the builds manually:
* find: `(- [^=]+=[^=-]+)=[^\n=-]+`
* replace: `$1`
- AStar algorithm is applied to resulting graph by using AStarShortestPath by JGraphT
This works on JetBrains IDEs at least.
- algorithm is adapted to our requirements by checking for turn restrictions and forbidden weather conditions for the edges of the path and by searching in a given period of time
so that the dependencies are reflected in the state of the project.
- heuristic: haversine distance between current and target node
The proto sample should be in the directory `debug-tool/proto/sample` and the tool would take it automatically.