# heronsystems/gym-jsbsim-f16 architecture

> Architecture diagram of the GitHub repository heronsystems/gym-jsbsim-f16, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/heronsystems/gym-jsbsim-f16
- Repository: https://github.com/heronsystems/gym-jsbsim-f16

## Overview

##### Main Components Identification

a) Core Components:
- JSBSim Flight Dynamic Model (External Integration)
- OpenAI Gym Environment Interface
- Task Environments
- Simulation Engine
- Aircraft Models/Configurations

b) Supporting Components:
- Catalogs System
- Property Management
- State Management
- Autopilot System
- Geographic/Spatial Data Management (AMDB files)

**┌─────────────────────────────────────────────────────────┐**
- Client Applications                   │
- (test_agent.py, notebooks, external RL implementations)│
- ┬─────────────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────────┐**
- Gym Environment                       │
- ┌───────────────┐  ┌──────────────┐  ┌──────────────┐ │
- Task Environments│  │State Manager │  │Action Manager│ │
- ┘  └──────────────┘  └──────────────┘ │
- ┬─────────────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────────┐**
- Simulation Layer                        │
- ┌───────────────┐  ┌──────────────┐  ┌──────────────┐ │
- JSBSim Interface│  │Property      │  │Catalog       │ │
- (simulation.py) │  │Management    │  │System        │ │
- ┘  └──────────────┘  └──────────────┘ │
- ┬─────────────────────────────────────┘
- ↓
**┌─────────────────────────────────────────────────────────┐**
- Data Layer                           │
- ┌───────────────┐  ┌──────────────┐  ┌──────────────┐ │
- Aircraft Models │  │AMDB Data     │  │Configuration │ │
- (A320, etc.)   │  │(Airport Data)│  │Files         │ │
- ┘  └──────────────┘  └──────────────┘ │
- ┘

##### Component Relationships
- Bidirectional communication between Gym Environment and Task Environments
- Data flow between JSBSim Interface and Aircraft Models
- How the Catalog System interfaces with all components
- Demonstrate the relationship between Task Environments and their specific data requirements

##### Notes
- Notes about the discrete vs continuous action spaces
- Information about the reward computation methods
- Mention the state observation space structure
- Document the interface with external RL algorithms

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client["Client Applications"]
        TestAgent["Test Agent"]
        Notebooks["Jupyter Notebooks"]
        RLImpl["External RL Implementations"]
    end

    subgraph GymEnv["Gym Environment Layer"]
        GymInterface["OpenAI Gym Interface"]:::gym
        click GymInterface "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/jsbsim_env.py"
        TaskBase["Base Task Interface"]:::task
        click TaskBase "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/task.py"
        
        subgraph Tasks["Task Environments"]
            HeadingTask["Heading Control"]:::task
            TaxiTask["Taxi Control"]:::task
            ApproachTask["Approach Control"]:::task
            click HeadingTask "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/envs/heading_control_task.py"
            click TaxiTask "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/envs/taxi_control_task.py"
            click ApproachTask "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/envs/approach_control_task.py"
        end
    end

    subgraph SimLayer["Simulation Layer"]
        JSBSimInterface["JSBSim Interface"]:::core
        SimEngine["Simulation Engine"]:::core
        click SimEngine "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/simulation.py"
        
        subgraph CatSystem["Catalog System"]
            MainCat["Main Catalog"]:::catalog
            JSBSimCat["JSBSim Catalog"]:::catalog
            PropMgmt["Property Management"]:::catalog
            click MainCat "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/catalogs/catalog.py"
            click JSBSimCat "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/catalogs/jsbsim_catalog.py"
            click PropMgmt "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/catalogs/property.py"
        end
    end

    subgraph DataLayer["Data Layer"]
        subgraph Aircraft["Aircraft Models"]
            A320["A320 Model"]:::data
            A320Config["A320 Configuration"]:::data
            A320AP["A320 Autopilot"]:::data
            click A320 "https://github.com/heronsystems/gym-jsbsim-f16/tree/master/gym_jsbsim/docs/aircraft/A320/"
            click A320Config "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/docs/aircraft/A320/A320.xml"
            click A320AP "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/gym_jsbsim/docs/aircraft/A320/A320ap.xml"
        end

        subgraph GeoData["Geographic Data"]
            Runway["Runway Data"]:::data
            Taxiway["Taxiway Data"]:::data
            AirportRef["Airport Reference"]:::data
            click Runway "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/amdb/AM_RunwayElement.shp"
            click Taxiway "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/amdb/AM_TaxiwayElement.shp"
            click AirportRef "https://github.com/heronsystems/gym-jsbsim-f16/blob/master/amdb/AM_AerodromeReferencePoint.shp"
        end
    end

    %% Relationships
    TestAgent & Notebooks & RLImpl --> GymInterface
    GymInterface --> TaskBase
    TaskBase --> Tasks
    Tasks --> SimEngine
    SimEngine --> JSBSimInterface
    JSBSimInterface --> Aircraft
    TaxiTask --> GeoData
    CatSystem --> SimEngine
    PropMgmt --> JSBSimInterface

    %% Styles
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef gym fill:#4CAF50,stroke:#2E7D32,color:white
    classDef task fill:#FF9800,stroke:#EF6C00,color:white
    classDef data fill:#FDD835,stroke:#F9A825,color:black
    classDef catalog fill:#9C27B0,stroke:#6A1B9A,color:white

    %% Legend
    subgraph Legend
        CoreComp["Core Component"]:::core
        GymComp["Gym Interface"]:::gym
        TaskComp["Task Component"]:::task
        DataComp["Data Component"]:::data
        CatalogComp["Catalog Component"]:::catalog
    end
```
