# insanytil/projet_os_2_2024-2025 architecture

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

- Interactive diagram: https://gitdiagram.com/insanytil/projet_os_2_2024-2025
- Repository: https://github.com/insanytil/projet_os_2_2024-2025

## Overview

C’est une simulation interactive de championnat de Formule 1. L’utilisateur crée ou charge un championnat, consulte le classement ou choisit une course ; le type de course détermine un week-end classique ou sprint, avec séances et résultats, puis le championnat peut être sauvegardé. Les voitures simulent les tours dans des processus partageant leur état via la mémoire System V et des sémaphores. Le README documente ces capacités ; les extraits confirment notamment les menus, le dispatch des courses et la simulation des voitures. Les détails de câblage internes à weekend.c sont partiellement échantillonnés.

Main entry points: [`weekend.c`](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c) (Orchestration du week-end), [`main.c`](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/main.c) (Menus championnat), [`courses.c`](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/courses.c) (Catalogue et choix courses), [`voitures.c`](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c) (Tours et incidents voiture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_championship["Championnat"]
  node_menus["Menus championnat<br/>[main.c]"]
  node_drivers["Pilotes et classement<br/>[pilotes.c]"]
  node_courses["Catalogue et choix courses<br/>[courses.c]"]
end

subgraph group_weekend["Week-end"]
  node_weekend_entry["Orchestration du week-end<br/>[weekend.c]"]
  node_practice["Practice<br/>[weekend.c]"]
  node_qualifying["Qualifications<br/>[weekend.c]"]
  node_race["Course et sprint<br/>[weekend.c]"]
  node_points["Attribution des points<br/>[weekend.c]"]
end

subgraph group_simulation["Simulation voitures"]
  node_car_model["Tours et incidents voiture<br/>[voitures.c]"]
  node_shared_state[("État partagé IPC<br/>[voitures.c]")]
  node_semaphores["Verrous System V<br/>[voitures.c]"]
  node_processes["Processus voitures<br/>[weekend.c]"]
end

subgraph group_persistence["Données et sauvegardes"]
  node_csv_drivers["CSV pilotes<br/>[pilotes.csv]"]
  node_csv_courses["CSV courses<br/>[courses.csv]"]
  node_save_files[("Sauvegardes et résultats<br/>[sauvegarde.c]")]
end

node_user(("Utilisateur"))

node_user -->|"choisit"| node_menus
node_menus -->|"charge ou classe"| node_drivers
node_menus -->|"charge courses"| node_courses
node_csv_drivers -->|"alimente"| node_drivers
node_csv_courses -->|"alimente"| node_courses
node_menus -->|"lance le choix"| node_courses
node_courses -->|"dispatch type"| node_weekend_entry
node_weekend_entry -->|"coordonne"| node_practice
node_weekend_entry -->|"coordonne"| node_qualifying
node_weekend_entry -->|"coordonne"| node_race
node_weekend_entry -->|"attribue"| node_points
node_weekend_entry -->|"supervise"| node_processes
node_processes -.->|"simule tours"| node_car_model
node_car_model -->|"met à jour"| node_shared_state
node_processes -->|"partage état"| node_shared_state
node_processes -->|"synchronise"| node_semaphores
node_weekend_entry -->|"enregistre séances"| node_save_files
node_menus -->|"charge ou sauvegarde"| node_save_files

click node_menus "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/main.c"
click node_drivers "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/pilotes.c"
click node_courses "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/courses.c"
click node_weekend_entry "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c"
click node_practice "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c"
click node_qualifying "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c"
click node_race "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c"
click node_points "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c"
click node_car_model "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c"
click node_shared_state "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c"
click node_semaphores "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c"
click node_processes "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c"
click node_csv_drivers "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/data/pilotes.csv"
click node_csv_courses "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/data/courses.csv"
click node_save_files "https://github.com/insanytil/projet_os_2_2024-2025/blob/main/sauvegarde.c"

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_menus,node_drivers,node_courses toneBlue
class node_weekend_entry,node_practice,node_qualifying,node_race,node_points toneAmber
class node_car_model,node_shared_state,node_semaphores,node_processes toneMint
class node_csv_drivers,node_csv_courses,node_save_files toneRose
class node_user toneIndigo
```

## Components

### Championnat

- [Menus championnat](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/main.c): `main.c`
- [Pilotes et classement](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/pilotes.c): `pilotes.c`
- [Catalogue et choix courses](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/courses.c): `courses.c`

### Week-end

- [Orchestration du week-end](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c): `weekend.c`
- [Practice](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c): `weekend.c`
- [Qualifications](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c): `weekend.c`
- [Course et sprint](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c): `weekend.c`
- [Attribution des points](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c): `weekend.c`

### Simulation voitures

- [Tours et incidents voiture](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c): `voitures.c`
- [État partagé IPC](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c): `voitures.c`
- [Verrous System V](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/voitures.c): `voitures.c`
- [Processus voitures](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/weekend.c): `weekend.c`

### Données et sauvegardes

- [CSV pilotes](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/data/pilotes.csv): `data/pilotes.csv`
- [CSV courses](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/data/courses.csv): `data/courses.csv`
- [Sauvegardes et résultats](https://github.com/insanytil/projet_os_2_2024-2025/blob/main/sauvegarde.c): `sauvegarde.c`

### Other components

- **Utilisateur**

## Connections

- Utilisateur → Menus championnat: choisit (evidence: `README.md`)
- Menus championnat → Pilotes et classement: charge ou classe (evidence: `main.c`)
- Menus championnat → Catalogue et choix courses: charge courses (evidence: `main.c`)
- CSV pilotes → Pilotes et classement: alimente
- CSV courses → Catalogue et choix courses: alimente
- Menus championnat → Catalogue et choix courses: lance le choix (evidence: `main.c`)
- Catalogue et choix courses → Orchestration du week-end: dispatch type (evidence: `courses.c`)
- Orchestration du week-end → Practice: coordonne (evidence: `README.md`)
- Orchestration du week-end → Qualifications: coordonne (evidence: `README.md`)
- Orchestration du week-end → Course et sprint: coordonne (evidence: `README.md`)
- Orchestration du week-end → Attribution des points: attribue (evidence: `weekend.c`)
- Orchestration du week-end → Processus voitures: supervise (evidence: `weekend.c`)
- Processus voitures → Tours et incidents voiture: simule tours
- Tours et incidents voiture → État partagé IPC: met à jour (evidence: `voitures.c`)
- Processus voitures → État partagé IPC: partage état (evidence: `README.md`)
- Processus voitures → Verrous System V: synchronise (evidence: `README.md`)
- Orchestration du week-end → Sauvegardes et résultats: enregistre séances (evidence: `README.md`)
- Menus championnat → Sauvegardes et résultats: charge ou sauvegarde (evidence: `main.c`)
