# audhiaprilliant/monopoly-game-board-simulation architecture

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

- Interactive diagram: https://gitdiagram.com/audhiaprilliant/monopoly-game-board-simulation
- Repository: https://github.com/audhiaprilliant/monopoly-game-board-simulation

## Overview

##### Main Components
a. Core Simulation Engine:
- Represented by main.py, which is likely the entry point for executing the simulation.
- This component orchestrates game play: reading configurations, managing game state, and applying game rules.
b. Configuration Manager/Data Provider:
- The config directory holds JSON files (e.g., board_spaces.json under config/asset and chance_community_card.json under config/card).
- This component is in charge of providing game data – such as board layout, card details, and potentially other game-specific assets.
c. Analysis/Experimentation Environment:
- The notebook directory contains several Jupyter notebooks that likely are used to create visualizations and run different scenarios (e.g., “Creating Monopoly Game Board Simulation with Python.ipynb”, “Most Visited Monopoly Properties” notebooks).
- These are used to interact with the simulation, analyze outcomes, and possibly fine-tune simulation parameters.

##### Detail the Relationships and Interactions
- The Simulation Engine (main.py) reads in the JSON configurations from the config folder to understand the board layout and card probabilities.
- There is a flow from configuration data → simulation engine → output (which might then be visualized/analyzed by the notebooks).
- The notebooks might serve to run experiments against the simulation engine, displaying processed data and simulation statistics.
- External libraries (likely defined in requirements.txt) support tasks such as JSON data parsing, simulation logic, and visualization (possibly using libraries like pandas, matplotlib, etc.).

##### Architectural Patterns and Design Principles
- Modularity: The separation of configuration (JSON files), simulation logic (main.py), and analysis (Jupyter notebooks) reflects a modular design.
- Configuration as Code: External JSON files abstract game details from the simulation logic, allowing the simulation to be easily modified without code changes.
- Data Flow: Emphasize that data is externally defined and injected into the simulation engine, then the results are potentially fed into the analytical notebooks for report generation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Configuration/Data Provider
    subgraph "Configuration/Data Provider"
        boardConfig["Board Configuration"]:::config
        cardConfig["Card Configuration"]:::config
    end

    %% Simulation Engine
    subgraph "Simulation Engine"
        simulation["Simulation Engine (main.py)"]:::engine
    end

    %% Analysis/Experimentation Environment
    subgraph "Analysis/Experimentation Environment"
        simulationNotebook["Notebook: Monopoly Game Board Simulation"]:::analysis
        analysisNotebook1["Notebook: Most Visited Monopoly Properties - Final"]:::analysis
        analysisNotebook2["Notebook: [Duplicate] Most Visited Monopoly Properties"]:::analysis
    end

    %% External Dependencies
    external["External Dependencies (requirements.txt)"]:::external

    %% Relationships
    boardConfig -->|"reads configuration"| simulation
    cardConfig -->|"reads configuration"| simulation
    simulation -->|"outputs simulation results"| simulationNotebook
    simulation -->|"outputs simulation results"| analysisNotebook1
    simulation -->|"outputs simulation results"| analysisNotebook2
    simulation -->|"uses"| external

    %% Click Events
    click simulation "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/main.py"
    click boardConfig "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/config/asset/board_spaces.json"
    click cardConfig "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/config/card/chance_community_card.json"
    click simulationNotebook "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/notebook/Creating Monopoly Game Board Simulation with Python.ipynb"
    click analysisNotebook1 "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/notebook/Most Visited Monopoly Properties - Final.ipynb"
    click analysisNotebook2 "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/notebook/[Duplicate] Most Visited Monopoly Properties.ipynb"
    click external "https://github.com/audhiaprilliant/monopoly-game-board-simulation/blob/master/requirements.txt"

    %% Styles
    classDef config fill:#f9c74f,stroke:#333,stroke-width:2px;
    classDef engine fill:#90be6d,stroke:#333,stroke-width:2px;
    classDef analysis fill:#f94144,stroke:#333,stroke-width:2px;
    classDef external fill:#577590,stroke:#fff,stroke-width:2px;
```
