# nahid-ahmdv/f1_laptime_simulator architecture

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

- Interactive diagram: https://gitdiagram.com/nahid-ahmdv/f1_laptime_simulator
- Repository: https://github.com/nahid-ahmdv/f1_laptime_simulator

## Overview

This repository is a notebook-based F1 lap-time simulator. Its documented workflow loads a FastF1 session and fastest-lap telemetry, prepares and discretizes track data, computes vehicle speed limits, optimizes a speed profile, then compares lap time and produces plots and an animation. The README describes these stages, but the notebook source was not sampled, so the graph reflects documented flow rather than verified implementation calls.

Main entry points: [`LapSim.ipynb`](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb) (Load session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Session and telemetry"]
  node_session["Load session<br/>[LapSim.ipynb]"]
  node_telemetry["Prepare telemetry<br/>[LapSim.ipynb]"]
end

subgraph group_model["Track and physics"]
  node_track["Discretize track<br/>[LapSim.ipynb]"]
  node_limits["Compute speed limits<br/>[LapSim.ipynb]"]
end

subgraph group_simulate["Lap simulation"]
  node_optimizer["Optimize speed profile<br/>[LapSim.ipynb]"]
  node_lap_time["Integrate lap time<br/>[LapSim.ipynb]"]
end

subgraph group_results["Results and visuals"]
  node_comparison["Compare telemetry<br/>[LapSim.ipynb]"]
  node_plots["Generate plots<br/>[LapSim.ipynb]"]
  node_animation["Animate track<br/>[LapSim.ipynb]"]
  node_summary["Print summary<br/>[LapSim.ipynb]"]
end

node_user(("User"))
node_fastf1["FastF1"]

node_user -->|"selects session"| node_session
node_session -->|"loads data"| node_fastf1
node_session -->|"extracts fastest lap"| node_telemetry
node_telemetry -->|"provides track data"| node_track
node_track -->|"supplies segments"| node_limits
node_limits -->|"constrains speeds"| node_optimizer
node_optimizer -->|"provides speeds"| node_lap_time
node_lap_time -->|"compares lap time"| node_comparison
node_comparison -->|"visualizes results"| node_plots
node_lap_time -->|"reports timing"| node_summary
node_optimizer -->|"animates lap"| node_animation

click node_session "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_telemetry "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_track "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_limits "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_optimizer "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_lap_time "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_comparison "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_plots "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_animation "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"
click node_summary "https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb"

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_session,node_telemetry,node_user toneBlue
class node_track,node_limits toneAmber
class node_optimizer,node_lap_time toneMint
class node_comparison,node_plots,node_animation,node_summary toneRose
class node_fastf1 toneIndigo
```

## Components

### Session and telemetry

- [Load session](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`
- [Prepare telemetry](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`

### Track and physics

- [Discretize track](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`
- [Compute speed limits](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`

### Lap simulation

- [Optimize speed profile](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`
- [Integrate lap time](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`

### Results and visuals

- [Compare telemetry](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`
- [Generate plots](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`
- [Animate track](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`
- [Print summary](https://github.com/nahid-ahmdv/f1_laptime_simulator/blob/main/LapSim.ipynb): `LapSim.ipynb`

### Other components

- **User**
- **FastF1**

## Connections

- User → Load session: selects session (evidence: `README.md`)
- Load session → FastF1: loads data (evidence: `README.md`)
- Load session → Prepare telemetry: extracts fastest lap (evidence: `README.md`)
- Prepare telemetry → Discretize track: provides track data (evidence: `README.md`)
- Discretize track → Compute speed limits: supplies segments (evidence: `README.md`)
- Compute speed limits → Optimize speed profile: constrains speeds (evidence: `README.md`)
- Optimize speed profile → Integrate lap time: provides speeds (evidence: `README.md`)
- Integrate lap time → Compare telemetry: compares lap time (evidence: `README.md`)
- Compare telemetry → Generate plots: visualizes results (evidence: `README.md`)
- Integrate lap time → Print summary: reports timing (evidence: `README.md`)
- Optimize speed profile → Animate track: animates lap (evidence: `README.md`)
