# mackorone/mms architecture

> Architecture diagram of the GitHub repository mackorone/mms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mackorone/mms
- Repository: https://github.com/mackorone/mms

## Overview

mms is a Micromouse simulator: an algorithm communicates over stdin/stdout, while the simulator runs it against a maze, applies its commands, and visualizes its state. The current `src/` tree contains the application; `old/` holds previous versions. The graph emphasizes the documented algorithm-to-result workflow and visible UI responsibilities. Several subsystem paths are based on the tree and README rather than sampled implementation, so those relationships are marked unverified.

Main entry points: [`src/Window.cpp`](https://github.com/mackorone/mms/blob/main/src/Window.cpp) (Simulator window), [`src/MazeView.cpp`](https://github.com/mackorone/mms/blob/main/src/MazeView.cpp) (Maze rendering), [`src/ProcessUtilities.cpp`](https://github.com/mackorone/mms/blob/main/src/ProcessUtilities.cpp) (Algorithm process), [`src/Maze.cpp`](https://github.com/mackorone/mms/blob/main/src/Maze.cpp) (Maze state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Simulation runtime"]
  node_app["Application entry<br/>[Main.cpp]"]
  node_driver["Runtime driver<br/>[Driver.cpp]"]
  node_window["Simulator window<br/>[Window.cpp]"]
  node_process["Algorithm process"]
  node_maze["Maze state<br/>[Maze.cpp]"]
  node_map["Map state<br/>[Map.cpp]"]
  node_mouse["Mouse state<br/>[Mouse.cpp]"]
  node_tile["Tile state<br/>[Tile.cpp]"]
end

subgraph group_visual["Maze visualization"]
  node_mazeview["Maze rendering<br/>[MazeView.cpp]"]
  node_mazegraphic["Maze graphics<br/>[MazeGraphic.cpp]"]
  node_mousegraphic["Mouse graphics<br/>[MouseGraphic.cpp]"]
  node_tilegraphic["Tile graphics<br/>[TileGraphic.cpp]"]
end

subgraph group_config["Configuration and results"]
  node_settings["User settings<br/>[Settings.cpp]"]
  node_colors["Color preferences<br/>[ColorManager.cpp]"]
  node_stats["Run statistics<br/>[Stats.cpp]"]
  node_maze_files["Maze file handling"]
end

node_operator(("Simulator user"))
node_algorithm(("Mouse algorithm"))
node_external(("External algorithm runtime"))

node_app -->|"starts"| node_driver
node_operator -.->|"controls"| node_window
node_window -->|"launches"| node_process
node_process -->|"runs"| node_algorithm
node_algorithm -->|"sends commands"| node_window
node_window -->|"returns responses"| node_algorithm
node_window -.->|"updates"| node_map
node_window -.->|"loads maze"| node_maze
node_window -.->|"moves"| node_mouse
node_maze -.->|"contains state"| node_tile
node_window -.->|"displays"| node_mazeview
node_mazeview -.->|"renders"| node_mazegraphic
node_mazegraphic -.->|"uses"| node_tilegraphic
node_mazeview -.->|"renders"| node_mousegraphic
node_window -.->|"reads settings"| node_settings
node_window -->|"edits colors"| node_colors
node_colors -->|"persists"| node_settings
node_window -.->|"records results"| node_stats
node_operator -.->|"selects maze"| node_maze_files
node_maze_files -.->|"provides maze"| node_maze
node_external -->|"communicates via stdio"| node_process

click node_app "https://github.com/mackorone/mms/blob/main/src/Main.cpp"
click node_driver "https://github.com/mackorone/mms/blob/main/src/Driver.cpp"
click node_window "https://github.com/mackorone/mms/blob/main/src/Window.cpp"
click node_process "https://github.com/mackorone/mms/blob/main/src/ProcessUtilities.cpp"
click node_maze "https://github.com/mackorone/mms/blob/main/src/Maze.cpp"
click node_map "https://github.com/mackorone/mms/blob/main/src/Map.cpp"
click node_mouse "https://github.com/mackorone/mms/blob/main/src/Mouse.cpp"
click node_tile "https://github.com/mackorone/mms/blob/main/src/Tile.cpp"
click node_mazeview "https://github.com/mackorone/mms/blob/main/src/MazeView.cpp"
click node_mazegraphic "https://github.com/mackorone/mms/blob/main/src/MazeGraphic.cpp"
click node_mousegraphic "https://github.com/mackorone/mms/blob/main/src/MouseGraphic.cpp"
click node_tilegraphic "https://github.com/mackorone/mms/blob/main/src/TileGraphic.cpp"
click node_settings "https://github.com/mackorone/mms/blob/main/src/Settings.cpp"
click node_colors "https://github.com/mackorone/mms/blob/main/src/ColorManager.cpp"
click node_stats "https://github.com/mackorone/mms/blob/main/src/Stats.cpp"
click node_maze_files "https://github.com/mackorone/mms/blob/main/src/SettingsMazeFiles.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_driver,node_window,node_process,node_maze,node_map,node_mouse,node_tile,node_operator toneBlue
class node_mazeview,node_mazegraphic,node_mousegraphic,node_tilegraphic toneAmber
class node_settings,node_colors,node_stats,node_maze_files toneMint
class node_algorithm,node_external toneIndigo
```

## Components

### Simulation runtime

- [Application entry](https://github.com/mackorone/mms/blob/main/src/Main.cpp): `src/Main.cpp`
- [Runtime driver](https://github.com/mackorone/mms/blob/main/src/Driver.cpp): `src/Driver.cpp`
- [Simulator window](https://github.com/mackorone/mms/blob/main/src/Window.cpp): `src/Window.cpp`
- [Algorithm process](https://github.com/mackorone/mms/blob/main/src/ProcessUtilities.cpp): `src/ProcessUtilities.cpp`
- [Maze state](https://github.com/mackorone/mms/blob/main/src/Maze.cpp): `src/Maze.cpp`
- [Map state](https://github.com/mackorone/mms/blob/main/src/Map.cpp): `src/Map.cpp`
- [Mouse state](https://github.com/mackorone/mms/blob/main/src/Mouse.cpp): `src/Mouse.cpp`
- [Tile state](https://github.com/mackorone/mms/blob/main/src/Tile.cpp): `src/Tile.cpp`

### Maze visualization

- [Maze rendering](https://github.com/mackorone/mms/blob/main/src/MazeView.cpp): `src/MazeView.cpp`
- [Maze graphics](https://github.com/mackorone/mms/blob/main/src/MazeGraphic.cpp): `src/MazeGraphic.cpp`
- [Mouse graphics](https://github.com/mackorone/mms/blob/main/src/MouseGraphic.cpp): `src/MouseGraphic.cpp`
- [Tile graphics](https://github.com/mackorone/mms/blob/main/src/TileGraphic.cpp): `src/TileGraphic.cpp`

### Configuration and results

- [User settings](https://github.com/mackorone/mms/blob/main/src/Settings.cpp): `src/Settings.cpp`
- [Color preferences](https://github.com/mackorone/mms/blob/main/src/ColorManager.cpp): `src/ColorManager.cpp`
- [Run statistics](https://github.com/mackorone/mms/blob/main/src/Stats.cpp): `src/Stats.cpp`
- [Maze file handling](https://github.com/mackorone/mms/blob/main/src/SettingsMazeFiles.cpp): `src/SettingsMazeFiles.cpp`

### Other components

- **Simulator user**
- **Mouse algorithm**
- **External algorithm runtime**

## Connections

- Application entry → Runtime driver: starts (evidence: `src/Main.cpp`)
- Simulator user → Simulator window: controls
- Simulator window → Algorithm process: launches (evidence: `src/Window.cpp`)
- Algorithm process → Mouse algorithm: runs
- Mouse algorithm → Simulator window: sends commands
- Simulator window → Mouse algorithm: returns responses
- Simulator window → Map state: updates
- Simulator window → Maze state: loads maze
- Simulator window → Mouse state: moves
- Maze state → Tile state: contains state
- Simulator window → Maze rendering: displays
- Maze rendering → Maze graphics: renders
- Maze graphics → Tile graphics: uses
- Maze rendering → Mouse graphics: renders
- Simulator window → User settings: reads settings
- Simulator window → Color preferences: edits colors (evidence: `src/Window.cpp`)
- Color preferences → User settings: persists (evidence: `src/ColorManager.cpp`)
- Simulator window → Run statistics: records results
- Simulator user → Maze file handling: selects maze
- Maze file handling → Maze state: provides maze
- External algorithm runtime → Algorithm process: communicates via stdio
