Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed icon and update conda entry point #44

Merged
merged 2 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Contributing to airtrafficsim

The latest contributing guide is available in the documentation at: https://hkust-octad-lab.github.io/AirTrafficSim/development/guide.html

If you encounter any bugs, please report them in the [Issues board](https://github.com/HKUST-OCTAD-LAB/AirTrafficSim/issues).

Please also feel free to contact us through the [discussin board](https://github.com/HKUST-OCTAD-LAB/AirTrafficSim/discussions) and/or raise any suggestion.

If you would like to contribute to AirTrafficSim, please fork this repository and create any pull requests. You may download AirTrafficSim with:

```
git clone https://github.com/HKUST-OCTAD-LAB/AirTrafficSim.git
conda env create -f environment.yml

cd AirTrafficSim
conda activate airtrafficsim
<!-- With UI -->
python -m airtrafficsim
<!-- Without UI -->
python -m airtrafficsim --headless <environment name>
```

Please also be reminded to unzip BADA 3.15 data files to [airtrafficsim_data/performance/BADA](data/performance/BADA/) and setup the API key for the weather database from ECMWF Climate Data Store following [this guide](https://cds.climate.copernicus.eu/api-how-to).


## Code of Conduct

We abide by the principles of openness, respect, and consideration of others
of the Python Software Foundation: https://www.python.org/psf/codeofconduct/.
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# AirTrafficSim

AirTrafficSim is a web-based air traffic simulation software written in Python and javascript. It is designed to visualize historical and research data, perform microscopic studies of air traffic movement with the integration of a historical weather database, and evaluate the performance of ATM algorithms.
![AirTrafficSim](docs/source/images/Logo-full.png)

![Tests](https://github.com/HKUST-OCTAD-LAB/AirTrafficSim/actions/workflows/tests.yml/badge.svg)
[![Code Coverage](https://img.shields.io/codecov/c/github/HKUST-OCTAD-LAB/AirTrafficSim.svg)](https://codecov.io/gh/HKUST-OCTAD-LAB/AirTrafficSim)
Expand All @@ -9,11 +7,12 @@ AirTrafficSim is a web-based air traffic simulation software written in Python a
[![status](https://joss.theoj.org/papers/7d4a9fdfae0c862863fa3645d3ae80b1/status.svg)](https://joss.theoj.org/papers/7d4a9fdfae0c862863fa3645d3ae80b1)
<!-- ![Conda version](https://img.shields.io/conda/vn/conda-forge/) -->

AirTrafficSim is a web-based air traffic simulation software written in Python and javascript. It is designed to visualize historical and research data, perform microscopic studies of air traffic movement with the integration of a historical weather database, and evaluate the performance of ATM algorithms.

## Features

- Replay histortic flights given data (FlightRadar 24 and simulated flights)
- Air traffic simulation using [BADA performance data](https://www.eurocontrol.int/model/bada)
- Air traffic simulation using [BADA 3.15 performance data](https://www.eurocontrol.int/model/bada)
- Navigation data simulation and visualization from [x-plane 11](https://developer.x-plane.com/docs/data-development-documentation/)
- Autopilot and Flight Management System simulation
- ATC traffic control methodology (Holding, vectoring, direct) simulation
Expand All @@ -32,50 +31,55 @@ If you find AirTrafficSim useful for your research, please cite the following un
author = {Ka Yiu Hui, Chris HC. Nguyen, Go Nam Lui, Rhea P. Liem},
title = {AirTrafficSim},
url = {https://github.com/HKUST-OCTAD-LAB/AirTrafficSim},
version = {0.0},
date = {2022-10-10},
version = {0.0.1},
date = {2023-05-01},
}
```

## Installation

Conda environment is required to setup AirTrafficSim. All dependencies will be installated automatically and the client has been pre-built and is ready for use after download.
The latest stable release of AirTrafficSim can be installed from conda-forge. All dependencies will be installated automatically with the client pre-built and ready for use directly after installation.

It is recommended to install AirTrafficSim in a new conda environment:

```
conda create -n airtrafficsim -c conda-forge conda
```

To download, enter the following command:
Then, please initialise AirTrafficSim by specifing a folder path to create a symbolic link to the [airtrafficsim_data](data/) folder:

```
git clone https://github.com/HKUST-OCTAD-LAB/AirTrafficSim.git
conda env create -f environment.yml
activate airtrafficsim
airtrafficsim -- init <path to a folder>
```
You may provide or retrieve any data of AirTrafficSim and create simulation environments in this folder. Please visit the [documentation](https://hkust-octad-lab.github.io/AirTrafficSim/index.html) for more information.

After installation, please also download, unzip, and store BADA data in [data/performance/BADA](data/performance/BADA/). In addition follow [this guide](https://cds.climate.copernicus.eu/api-how-to) to setup the API key for the weather database from ECMWF Climate Data Store.
After installation, please also download, unzip, and store BADA 3.15 data files in [airtrafficsim_data/performance/BADA](data/performance/BADA/). In addition follow [this guide](https://cds.climate.copernicus.eu/api-how-to) to setup the API key for the weather database from ECMWF Climate Data Store.


## Running AirTrafficSim

You can run AirTrafficSim by executing the following commands. It uses port 6111 for communicaiton. Please open or forward the port accordingly if needed.
You can run AirTrafficSim by executing the following commands. Please be reminded to activate the conda environment when you want to use AirTrafficSim.

```
cd AirTrafficSim
conda activate airtrafficsim
python -m airtrafficsim
airtrafficsim
```

You should be able to open the UI using any modern browser at http://localhost:6111.
AirTrafficSim uses port 6111 for communicaiton. Please open or forward the port accordingly if needed. You should be able to open the UI using any modern browser at http://localhost:6111. You may also check the console for any messages when using AirTrafficSim.


You can also run AirTrafficSim without the UI by providing the name of an environment which is listed in [environment](environment/). The environment name should be identical to the file name.
You can also run AirTrafficSim without the UI by providing the name of the simulation environment which is listed in [environment](data/environment/). The environment name should be identical to the file name.

```
cd AirTrafficSim
conda activate airtrafficsim
python -m airtrafficsim --headless <environment name>
airtrafficsim --headless <environment name>
```

## Documentation

The detailed documentation for AirTrafficSim is available at [https://hkust-octad-lab.github.io/AirTrafficSim/](https://hkust-octad-lab.github.io/AirTrafficSim/).
The detailed documentation for AirTrafficSim is available at [https://hkust-octad-lab.github.io/AirTrafficSim/](https://hkust-octad-lab.github.io/AirTrafficSim/), which include tutorials on navigations the UI and project structure as well as running different simulation environment.

## Contribution

AirTrafficSim is under active development. We welcome everyone intersted to contribute to the project and make AirTrafficSim more feature-rich. Please feel free to raise any feature suggestion or bugs in the Issues board. Please also feel free to create any pull requests.
AirTrafficSim is under active development. We welcome everyone intersted to contribute to the project and make AirTrafficSim more feature-rich. Please feel free to visit the detailed [contribution guide](./CONTRIBUTING.md) in this repository or in the [documentation](https://hkust-octad-lab.github.io/AirTrafficSim/development/guide.html).
49 changes: 34 additions & 15 deletions airtrafficsim/__main__.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,53 @@
import sys
import os
import argparse
from pathlib import Path
from importlib import import_module
from zipfile import ZipFile

import airtrafficsim.server.server as server


def main():
# Give error if BADA data is missing TODO: To be removed when OpenAP is implemented
if len(os.listdir('data/performance/BADA/')) <= 1:
raise IOError(
"BADA folder is empty. Remember to put the BADA performance data into /data/performance/BADA/.")

# Unpack client
if not Path(__file__).parent.parent.resolve().joinpath('./data/client/build/').is_dir():
print("Unzipping client.")
ZipFile(Path(__file__).parent.parent.resolve().joinpath('./data/client/build.zip')
).extractall(Path(__file__).parent.parent.resolve().joinpath('./data/client/'))

# Handle command line arguments
if len(sys.argv) > 1 and sys.argv[1] == '--headless':
# Run user defined environment without UI: python -m airtrafficsim --headless <env name>
Env = getattr(import_module('data.environment.' +
sys.argv[2], '...'), sys.argv[2])
env = Env()
env.run()
# Create a parser for command line arguments
parser = argparse.ArgumentParser(
prog='AirTrafficSim',
description='Command line interfaces of AirTrafficSim.'
)
parser.add_argument('--init',
type=Path,
help='Create a symbloic link to the data folder: airtrafficsim init <path to a folder>.')
parser.add_argument('--headless',
type=str,
help='Run user defined environment without UI: airtrafficsim --headless <env name>.')

args = parser.parse_args()

if args.init:
# Create a symbolic link to the data folder
if Path.cwd().joinpath(args.init).is_dir():
Path.cwd().joinpath(args.init).resolve().joinpath('airtrafficsim_data').symlink_to(Path(__file__).parent.parent.resolve().joinpath('./data'), target_is_directory=True)
else:
raise IOError("The path you provided does not exist. Please provide a valid path.")
else:
# Run UI: python -m airtrafficsim
server.run_server()
# Give error if BADA data is missing TODO: To be removed when OpenAP is implemented
if len(os.listdir('data/performance/BADA/')) <= 1:
raise IOError(
"BADA folder is empty. Remember to put the BADA performance data into /data/performance/BADA/.")
if args.headless:
# Run user defined environment without UI
Env = getattr(import_module('data.environment.' +
sys.argv[2], '...'), sys.argv[2])
env = Env()
env.run()
else:
# Run AirTrafficSim with UI
server.run_server()


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions client/public/assets/icon/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading