# thiagoqueir0z/42-fly-in architecture

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

- Interactive diagram: https://gitdiagram.com/thiagoqueir0z/42-fly-in
- Repository: https://github.com/thiagoqueir0z/42-fly-in

## Overview

Fly-in routes multiple drones across a capacity-constrained zone network. The workflow loads a map, builds its graph, plans coordinated routes, simulates turn-by-turn movement, then renders the recorded history. The README also describes collision-aware space-time reservations, priority/restricted-zone costs, terminal colors, and an animated 2D view. Edges reflect calls or data use visible in the excerpts and source index; unshown algorithm internals are represented by their documented Pathfinder component, not expanded into speculative modules.

Main entry points: [`src/simulator/simulator.py`](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/simulator/simulator.py) (Turn simulator), [`src/model/graph.py`](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/graph.py) (Network graph), [`src/main.py`](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/main.py) (CLI entry), [`src/parser/map_parser.py`](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/parser/map_parser.py) (Map parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Map ingestion"]
  node_parser["Map parser<br/>[map_parser.py]"]
end

subgraph group_network["Network model"]
  node_graph["Network graph<br/>[graph.py]"]
  node_zone["Zone rules<br/>[zone.py]"]
  node_connection["Connection capacity<br/>[connection.py]"]
  node_drone["Drone state<br/>[drone.py]"]
end

subgraph group_planning["Route planning"]
  node_pathfinder["Cooperative planner<br/>[pathfinder.py]"]
end

subgraph group_execution["Simulation"]
  node_simulator["Turn simulator<br/>[simulator.py]"]
  node_terminal["Terminal moves<br/>[simulator.py]"]
end

subgraph group_presentation["Visualization"]
  node_visualizer["Animated renderer<br/>[visualizer.py]"]
end

node_user(("User"))
node_map_file["Map file"]
node_entry["CLI entry<br/>[main.py]"]

node_user -->|"runs"| node_entry
node_map_file -->|"map input"| node_parser
node_entry -->|"parses map"| node_parser
node_parser -->|"builds graph"| node_graph
node_parser -->|"creates zones"| node_zone
node_parser -->|"creates links"| node_connection
node_graph -->|"stores zones"| node_zone
node_graph -->|"indexes links"| node_connection
node_entry -->|"plans routes"| node_pathfinder
node_pathfinder -->|"queries neighbors"| node_graph
node_pathfinder -->|"uses movement costs"| node_zone
node_entry -->|"runs routes"| node_simulator
node_simulator -->|"advances drones"| node_drone
node_simulator -->|"checks network"| node_graph
node_simulator -->|"checks capacity"| node_connection
node_simulator -->|"checks occupancy"| node_zone
node_simulator -->|"prints moves"| node_terminal
node_entry -->|"renders history"| node_visualizer
node_visualizer -->|"draws network"| node_graph

click node_entry "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/main.py"
click node_parser "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/parser/map_parser.py"
click node_graph "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/graph.py"
click node_zone "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/zone.py"
click node_connection "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/connection.py"
click node_drone "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/drone.py"
click node_pathfinder "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/pathfinder/pathfinder.py"
click node_simulator "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/simulator/simulator.py"
click node_terminal "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/simulator/simulator.py"
click node_visualizer "https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/visualizer/visualizer.py"

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_parser,node_user toneBlue
class node_graph,node_zone,node_connection,node_drone toneAmber
class node_pathfinder toneMint
class node_simulator,node_terminal toneRose
class node_visualizer,node_map_file toneIndigo
class node_entry toneTeal
```

## Components

### Map ingestion

- [Map parser](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/parser/map_parser.py): `src/parser/map_parser.py`

### Network model

- [Network graph](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/graph.py): `src/model/graph.py`
- [Zone rules](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/zone.py): `src/model/zone.py`
- [Connection capacity](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/connection.py): `src/model/connection.py`
- [Drone state](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/model/drone.py): `src/model/drone.py`

### Route planning

- [Cooperative planner](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/pathfinder/pathfinder.py): `src/pathfinder/pathfinder.py`

### Simulation

- [Turn simulator](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/simulator/simulator.py): `src/simulator/simulator.py`
- [Terminal moves](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/simulator/simulator.py): `src/simulator/simulator.py`

### Visualization

- [Animated renderer](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/visualizer/visualizer.py): `src/visualizer/visualizer.py`

### Other components

- **User**
- **Map file**
- [CLI entry](https://github.com/thiagoqueir0z/42-fly-in/blob/main/src/main.py): `src/main.py`

## Connections

- User → CLI entry: runs (evidence: `src/main.py`)
- Map file → Map parser: map input (evidence: `src/parser/map_parser.py`)
- CLI entry → Map parser: parses map (evidence: `src/main.py`)
- Map parser → Network graph: builds graph (evidence: `src/parser/map_parser.py`)
- Map parser → Zone rules: creates zones (evidence: `src/parser/map_parser.py`)
- Map parser → Connection capacity: creates links (evidence: `src/parser/map_parser.py`)
- Network graph → Zone rules: stores zones (evidence: `src/model/graph.py`)
- Network graph → Connection capacity: indexes links (evidence: `src/model/graph.py`)
- CLI entry → Cooperative planner: plans routes (evidence: `src/main.py`)
- Cooperative planner → Network graph: queries neighbors (evidence: `src/pathfinder/pathfinder.py`)
- Cooperative planner → Zone rules: uses movement costs (evidence: `src/pathfinder/pathfinder.py`)
- CLI entry → Turn simulator: runs routes (evidence: `src/main.py`)
- Turn simulator → Drone state: advances drones (evidence: `src/simulator/simulator.py`)
- Turn simulator → Network graph: checks network (evidence: `src/simulator/simulator.py`)
- Turn simulator → Connection capacity: checks capacity (evidence: `src/simulator/simulator.py`)
- Turn simulator → Zone rules: checks occupancy (evidence: `src/simulator/simulator.py`)
- Turn simulator → Terminal moves: prints moves (evidence: `src/simulator/simulator.py`)
- CLI entry → Animated renderer: renders history (evidence: `src/main.py`)
- Animated renderer → Network graph: draws network (evidence: `src/visualizer/visualizer.py`)
