# 2aa4-w24/a2-rescue-mission-team-108 architecture

> Architecture diagram of the GitHub repository 2aa4-w24/a2-rescue-mission-team-108, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/2aa4-w24/a2-rescue-mission-team-108
- Repository: https://github.com/2aa4-w24/a2-rescue-mission-team-108

## Overview

##### Main Components to Identify
- Exploration Command Center: The Explorer class implements the main control logic for exploration. This module coordinates the exploration strategy and should be depicted centrally.
- Drone Control & Commands: Include components for the DroneController, DroneCommand, MoveDrone, Direction, and possibly Energy – these classes form the action layer that controls the movement and state of the drone.
- Handling & Search: The AreaMap, GridSearch, and related classes (e.g., ClosestCreek, FindIsland, FindIslandState) are responsible for map parsing, grid search algorithms, and locating points of interest. Represent this as a module or service that processes input maps from the “maps” directory.
- Testing: Although test packages (under src/test) are not part of the runtime architecture, you might include them as a side note representing unit testing coverage for core functionalities.

##### Relationships and Interactions
- Runner initiates the process, invoking the Explorer.
- Explorer implements the control loop, delegating tasks to the DroneController and other strategy classes.
- The DroneController interacts with classes that perform specific movements or commands (such as MoveDrone and Direction) and may consult energy or strategy metrics.
- Handling classes are used to read the provided JSON maps, process them, and then feed data back into the exploration logic.
- Output Generation functions at the end of the process to write out logs, transcripts and visual representations, indicating interactions with file system components in the “outputs” directory.
- The design also encapsulates a strong separation of concerns between input (map parsing), command processing (exploration strategy), and output (result generation).

##### Architectural Patterns & Design Principles
- The overall structure follows a layered approach: an entry layer (Runner), a command center (Explorer), and supporting strategy components (drone control, mapping, search algorithms).
- There appears to be a clear separation between modules handling game-specific logic (navigation, path-finding, map search) and utility or infrastructure concerns (logging, file I/O).
- The use of Maven as well as GitHub Actions indicates a focus on automated build and CI/CD practices.

##### Relevant Technologies and Frameworks
- Java and Maven are the core tools.
- log4j2 is used for logging configuration.
- JSON is used for input/output (maps and POI details), and SVG for visual output.
- GitHub Actions (under .github/workflows) indicate the build automation process.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry & Control Layer
    subgraph "Entry & Control Layer"
        R["Runner (Entry Point)"]:::control
        EX["Explorer (Command Center)"]:::control
    end

    %% Drone Control Module
    subgraph "Drone Control Module"
        DC["DroneController"]:::drone
        DCom["DroneCommand"]:::drone
        MD["MoveDrone"]:::drone
        DIR["Direction"]:::drone
        EN["Energy"]:::drone
    end

    %% Map Processing Module
    subgraph "Map Processing Module"
        AM["AreaMap"]:::map
        GS["GridSearch"]:::map
        CC["ClosestCreek"]:::map
        FI["FindIsland"]:::map
        FIS["FindIslandState"]:::map
    end

    %% External I/O & Logging
    subgraph "External I/O & Logging"
        LC["Logging Configuration"]:::io
        MF["Map Files"]:::io
        OF["Output Files"]:::io
    end

    %% Testing (Unit Tests)
    subgraph "Testing (Unit Tests)"
        TEST["Unit Tests"]:::test
    end

    %% Connections
    R -->|"initiates"| EX
    EX -->|"controls"| DC
    DC -->|"executes"| DCom
    DC -->|"executes"| MD
    DC -->|"uses"| DIR
    DC -->|"checks"| EN
    EX -->|"processes"| AM
    AM -->|"runs"| GS
    GS -->|"evaluates"| CC
    GS -->|"evaluates"| FI
    GS -->|"tracks"| FIS
    MF -->|"supplies"| AM
    EX -->|"generates"| OF
    LC -->|"logs"| EX

    %% Styles
    classDef control fill:#f9f,stroke:#333,stroke-width:2px;
    classDef drone fill:#ccf,stroke:#333,stroke-width:2px;
    classDef map fill:#cfc,stroke:#333,stroke-width:2px;
    classDef io fill:#fc9,stroke:#333,stroke-width:2px;
    classDef test fill:#efe,stroke:#333,stroke-width:2px;

    %% Click Events
    click R "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/Runner.java"
    click EX "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/Explorer.java"
    click DC "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/DroneController.java"
    click DCom "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/DroneCommand.java"
    click MD "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/MoveDrone.java"
    click DIR "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/Direction.java"
    click EN "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/Energy.java"
    click AM "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/AreaMap.java"
    click GS "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/GridSearch.java"
    click CC "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/ClosestCreek.java"
    click FI "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/FindIsland.java"
    click FIS "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/java/ca/mcmaster/se2aa4/island/team108/FindIslandState.java"
    click LC "https://github.com/2aa4-w24/a2-rescue-mission-team-108/blob/main/src/main/resources/log4j2.xml"
    click MF "https://github.com/2aa4-w24/a2-rescue-mission-team-108/tree/main/maps/"
    click OF "https://github.com/2aa4-w24/a2-rescue-mission-team-108/tree/main/outputs/"
    click TEST "https://github.com/2aa4-w24/a2-rescue-mission-team-108/tree/main/src/test/"
```
