# tasye24/projet-glp architecture

> Architecture diagram of the GitHub repository tasye24/projet-glp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tasye24/projet-glp
- Repository: https://github.com/tasye24/projet-glp

## Overview

Based on our analysis of the file tree and README, this is an economic simulation application (“GLP Project 2025”) that mimics the economic behavior of a continent (Europe). It is built as a full desktop simulation with a graphical user interface, a simulation engine that processes economic data, and configuration/data management handling the simulation constants and input CSV files.

##### And Label Main Components
- Simulation Engine (src/engine): Split into two main areas:
– Map & Country Representation (src/engine/map): Classes like Map.java, Country.java, Block.java.
- GUI Module (src/gui): This is the user interface part, including MainGUI.java, various window classes (e.g., entry screens, settings, charts) and GUI elements. Mark clearly the “Presentation Layer” with its subcomponents like top menus and chart windows.
- External Dependencies (lib): Note the use of third-party libraries such as jfreechart, orsoncharts, junit, log4j, and others. These can be shown as support services providing extra functionality such as charting, testing, and logging.

##### Relationships and Data Flow
- The Configuration module supplies constants and file paths to the Data and Engine modules during initialization.
- The Data module is used by the Simulation Engine to load, parse, and manage simulation data (from CSV files) as well as economic indicators.
- The Simulation Engine uses its process subcomponents to compute aspects like GDP, unemployment, and poverty, then updates the simulation’s state.
- The GUI interacts directly with the Simulation Engine to start, pause or update the simulation and display outcomes on charts and maps.
- The Logging module monitors actions both from the engine and GUI, logging process details for troubleshooting and analysis.
- External libraries (from the lib directory) are integrated at various points: chart libraries in the GUI/charts area, testing libraries in the tests module, and configuration utilities.

##### Architectural Patterns and Design Principles
- Although not explicitly labeled MVC, there is a separation between the Simulation Engine (model/business logic) and the GUI (view/control). The simulation engine acts as a central “model” whose state is visualized by the GUI.
- The modular design is evident from the distinct directories (config, data, engine, gui); each “layer” has its clear responsibilities.
- There is likely a driver/controller aspect within MainGUI that routes user inputs to the underlying simulation processes (Event handling through buttons in the top menu, etc.).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Configuration Layer"
        configConf["Configuration/Constants"]:::config
    end

    subgraph "Data Layer"
        dataDomain["Data & Domain Model"]:::data
    end

    subgraph "Simulation Engine"
        engineMap["Map & Country Representation"]:::engine
        engineProcess["Simulation Engine / Process"]:::engine
        engineMap -->|"feeds"| engineProcess
    end

    subgraph "Presentation Layer"
        guiModule["GUI Module"]:::gui
    end

    subgraph "Logging/Monitoring"
        logModule["Logging/Monitoring"]:::log
    end

    subgraph "External Dependencies"
        externalModule["External Dependencies"]:::external
    end

    configConf -->|"supplies_constants"| dataDomain
    configConf -->|"supplies_constants"| engineProcess
    dataDomain -->|"provides_data"| engineProcess
    guiModule -->|"initiates_simulation"| engineProcess
    engineProcess -->|"updates_display"| guiModule
    engineProcess -->|"logs_activity"| logModule
    guiModule -->|"logs_user_events"| logModule
    externalModule -->|"charting_support"| guiModule
    externalModule -->|"testing_support"| engineProcess
    externalModule -->|"logging_support"| logModule

    click configConf "https://github.com/tasye24/projet-glp/tree/master/src/config"
    click dataDomain "https://github.com/tasye24/projet-glp/tree/master/src/data"
    click engineMap "https://github.com/tasye24/projet-glp/tree/master/src/engine/map"
    click engineProcess "https://github.com/tasye24/projet-glp/tree/master/src/engine/process"
    click guiModule "https://github.com/tasye24/projet-glp/tree/master/src/gui"
    click logModule "https://github.com/tasye24/projet-glp/tree/master/src/log"
    click externalModule "https://github.com/tasye24/projet-glp/tree/master/lib"

    classDef config fill:#e0f7fa,stroke:#006064,stroke-width:2px;
    classDef data fill:#e8f5e9,stroke:#1b5e20,stroke-width:2px;
    classDef engine fill:#fff9c4,stroke:#f57f17,stroke-width:2px;
    classDef gui fill:#fce4ec,stroke:#ad1457,stroke-width:2px;
    classDef log fill:#ede7f6,stroke:#5e35b1,stroke-width:2px;
    classDef external fill:#e1f5fe,stroke:#039be5,stroke-width:2px;
```
