# Air Traffic Simulation Framework for Testing Automated Air Traffic Control Solutions +
## 6 Implementation  
The simulation framework described in the previous chapters has been implemented in the MATLAB environment. The current version of is capable of retrieving aircraft surveillance data from the following sources:  
* OpenSky REST API [32] live API;
* ADS-B Exchange [29] live API or historical data archive.  
Figure 12: Control mode temporality with discrete data points.  
In practical applications, the OpenSky REST API has been identified as a suboptimal data source due to the frequent omission of the \"Aircraft Category\" field. Consequently, the simulation framework is designed to process any ADS-B data source formatted in the ADS-B Exchange v2 standard. The OpenSky Network API remains a viable option when an external aircraft agent is not connected, and the simulation relies on its internal position estimation algorithm, which does not incorporate aircraft type information.  
Airspace data can be retrieved from AIPs, ensuring access to up-to-date information. Platforms such as OpenAIP.net facilitate the export of airspace data in various geospatial formats, including OpenAir, a file format specifically designed for AIPs. While this data can be readily converted into any geospatial format compatible with MATLAB, such as GeoJSON, the responsibility for executing these conversions is delegated to the user.  
The simulation requires the following toolboxes:  
* Mapping Toolbox;
* Aerospace Toolbox.  
The case study implemented here is a simple examination of the performance of a very basic controller agent. Note, that the controller algorithms are not part of this study; now purely the characteristics of the traffic simulation are in focus. This simple controller agent has the following properties:  
* Accepts all requests;
* If aircraft are in conflict horizontally, rotates all aircraft by 30\({}^{\circ}\) to the left;
* If aircraft are in conflict vertically, the upper one is instructed to climb.  
The following performance indicators are selected to gain a basic understanding of the effectiveness of the sample controller agent. KPIs are to be measured in each iteration and summed for the simulation:  
* The number of separation minima infringements (separation minima values are considered assuming RVSM airspace based on ICAO Annex 11);
* The number of aircraft receiving ATC instructions;
* The total number of aircraft in the sector.  
The simulation was conducted in accordance with the framework illustrated in Figure 13. A representative visualization captured during the simulation process is presented in Figure 14. The source code of the simulation framework, including the modules used for the case study, is available as Supplementary Material ([[https://github.com/Rebekajager/Air-Traffic-Simulation](https://github.com/Rebekajager/Air-Traffic-Simulation)]([https://github.com/Rebekajager/Air-Traffic-Simulation](https://github.com/Rebekajager/Air-Traffic-Simulation)), accessed on 10 May 2025).  
Figure 13: Implementation of functions in the simulation.  
Figure 14: Example visualization with \(1^{\prime}\) speed vectors.  
Figure 15: Diagram of KPIs.