72 lines
3.3 KiB
Markdown
72 lines
3.3 KiB
Markdown
# Drone Simulator
|
|
|
|
This is an application for simulating Drone operations and reporting (fictive) traffic information for London tube
|
|
stations.
|
|
|
|
<div>
|
|
<div style="float:left;padding:0;margin:0">
|
|
<img style="height:45vh" src="./data/traffic-report.png">
|
|
</div>
|
|
<div><pre style="height:44vh; line-height:2.6em">
|
|
Elephant & Castle @ 08:03:47: MODERATE (drone: 5937,speed: 27km/h, distanceToStation: 343m)
|
|
Borough @ 08:05:47: MODERATE (drone: 5937,speed: 28km/h, distanceToStation: 346m)
|
|
Elephant & Castle @ 08:06:37: MODERATE (drone: 5937,speed: 32km/h, distanceToStation: 349m)
|
|
Elephant & Castle @ 08:06:38: HEAVY (drone: 5937,speed: 30km/h, distanceToStation: 347m)
|
|
Southwark @ 08:08:38: LIGHT (drone: 5937,speed: 115km/h, distanceToStation: 339m)
|
|
Pimlico @ 07:59:05: HEAVY (drone: 6043,speed: 37km/h, distanceToStation: 344m)
|
|
Westminster @ 08:04:13: HEAVY (drone: 6043,speed: 32km/h, distanceToStation: 347m)
|
|
Embankment @ 08:07:19: LIGHT (drone: 6043,speed: 29km/h, distanceToStation: 343m)
|
|
Charing Cross @ 08:08:04: HEAVY (drone: 6043,speed: 60km/h, distanceToStation: 348m)
|
|
Temple @ 08:08:37: LIGHT (drone: 6043,speed: 36km/h, distanceToStation: 345m)
|
|
</pre></div>
|
|
<div style="clear:both"></div>
|
|
</div>
|
|
|
|
## Prerequisites
|
|
|
|
This application is written with Java 16 and so needs to have Java 16 installed before building.
|
|
|
|
## Building application from source
|
|
|
|
To build the application run the following command in the root directory of the project:
|
|
|
|
> ./gradlew distZip
|
|
|
|
This will build a ZIP archive with the application in the ``./dist`` folder. Extract it anywhere on your system to
|
|
execute the application.
|
|
|
|
## Running application from sources
|
|
|
|
You can also run the application directly with Gradle without building a distribution. To run the application
|
|
execute the following:
|
|
|
|
> ./gradlew run --args="--data-dir=./data 5937 6043"
|
|
|
|
This will use the example data provided in the ``./data`` folder.
|
|
|
|
# Command line arguments
|
|
```
|
|
Usage: drone-simulator [-hVw] [-d=<dataDir>] [-p=<simulationSpeed>][-s=<shutDownTime>] [-t=<tubeStationsFile>] DRONES...
|
|
-d, --data-dir=<dataDir> The path to the drone data
|
|
-h, --help Show this help message and exit.
|
|
-p, --simulation-speed=<simulationSpeed> The speed of the simulation time. 0 (real-time) -> 1.0 (no time simulation, instant)
|
|
-s, --shut-down-time=<shutDownTime> At what time should the simulation terminate
|
|
-t, --tube-stations=<tubeStationsFile> The path to the tube stations data
|
|
-V, --version Print version information and exit.
|
|
```
|
|
|
|
## Output
|
|
|
|
The application outputs to artifacts after a successful simulation:
|
|
* The traffic reports are printed in the Console output
|
|
* An image file (traffic-report.png) is created in the current directory which contains the drone routes as well as
|
|
the waypoints.
|
|
|
|
For more details about the operation of the simulation a ``./logs`` directory will be created with logs from different
|
|
parts of the simulation:
|
|
* `./logs/dispatcher.log`: This log file contains logging from the dispatcher as the simulation proceeds.
|
|
* `./logs/drone-<xxxx>.log`: A log file per drone will be created to provide insights into each drone's operations
|
|
* `./logs/report.log`: This is the final traffic report log. It is the same information that is output to the
|
|
console at runtime while the simulations proceeds.
|
|
|