Skip to content
Snippets Groups Projects
Commit 13263f69 authored by yolas01's avatar yolas01
Browse files

Update README.md

parent b5335e00
No related branches found
No related tags found
No related merge requests found
......@@ -10,33 +10,23 @@ In order to create classes from the protos (in case the definition changed) one
protoc --proto_path=debug-tool/proto/schema --python_out=./debug-tool/proto debug-tool/proto/schema/roadnetwork.proto
```
## Initialise environment
## Endpoints
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
```sh
conda env export --from-history | grep -v "^prefix: " > environment.yml
```
- 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.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment