BLADE Project Structure

The project is divided into two directories: client and gym. client contains the source code for the web application, while gym contains the source code for the Gymnasium environment. As of this writing, both client and gym have their separate copy of the simulation engine, which is written in Typescript for the web application and Python for the Gymnasium environment. In the future, we will integrate these two implementations.

We use React and OpenLayers as the basis for the web application. Within the web application source code, the important folders are:

  • game: the simulation engine. gym also has a copy of this engine but written in Python.

  • gui: code for the map, the toolbar, and any other front-end functionalities.

  • scenarios: contains example scenario files in JSON format.

  • styles: contains styling for the web application.

  • tests: contains tests.

  • utils: contains helper functions and constants.

Since the simulation engine is relevant to both the client and gym code, we will discuss it later. We proceed with a breakdown of the code in gui, which is further organized into:

  • assets: contains SVG files of icons that show up on the map.

  • map: contains code for the map and the toolbar.

    • contextProviders: contains context providers like mouse position, current scenario time, and current simulation status.

    • featureCards: contains components for the various popups (called Cards) that appear when the user selects a map feature (like an aircraft or a ship).

    • mapLayers: contains the various map layers such as the base map layers and the various feature layers (e.g. aircraft, ship, routes, range rings, labels, etc.).

    • missionEditor: contains code for the mission creator and editor menus.

    • toolbar: contains code for the toolbar.

    • FeaturePopup.tsx: base component for the popup that appears when the user selects a map feature.

    • MultipleFeatureSelector.tsx: handles the case when the user clicks on more than one map feature.

    • ScenarioMap.tsx: the main file responsible for rendering the map, the map layers, and the toolbar.

  • styles: contains styling for the map.

The simulation engine is housed in client/src/game for the web application and in gym/blade for the Gymnasium environment. The project structure is:

  • db: the "database" which contains real/notional data for several units (i.e. aircraft, bases, SAMs, etc.).

  • engine: contains logic specific to the underlying simulation engine (the only thing currently in here is weapon engagement logic).

  • envs (only in gym): contains code defining the Gymnasium environments.

  • mission: contains logic for missions.

  • scenarios (only in gym): contains example scenario files in JSON format.

  • units: contains classes that define the various unit types in the simulation (e.g. aircraft,ship, bases, etc.).

  • utils (only in gym): contains helper functions and constants.

  • Game.*: the main class representing the simulation.

  • Scenario.*: the class representing a specific scenario.

  • Side.*: the class respresenting a side in the scenario.

Last updated