# juligassibe/tps-ia2 architecture

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

- Interactive diagram: https://gitdiagram.com/juligassibe/tps-ia2
- Repository: https://github.com/juligassibe/tps-ia2

## Overview

This repository is a collection of coursework exercises; the most integrated product is TP3/Ej3, a Pygame dinosaur game with manual, image-capture, TensorFlow, and genetic-training modes. The graph follows its game loop, AI, obstacles, and persisted training progress, while also representing substantial standalone exercise scripts. Connections for unsampled exercises and model-building code are omitted because their runtime relationships are not evidenced in the excerpts.

Main entry points: [`TP3/Ej3/main.py`](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/main.py) (Game loop), [`TP3/Ej3/Obstacle.py`](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Obstacle.py) (Obstacle base), [`TP3/Ej3/Dinosaur.py`](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Dinosaur.py) (Dinosaur), [`TP3/Ej3/Bird.py`](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Bird.py) (Bird obstacle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_game["Game runtime"]
  node_entry["Game loop<br/>[main.py]"]
  node_dino["Dinosaur<br/>[Dinosaur.py]"]
  node_cloud["Cloud<br/>[Cloud.py]"]
  node_obstacle["Obstacle base<br/>[Obstacle.py]"]
  node_bird["Bird obstacle<br/>[Bird.py]"]
  node_smallcactus["Small cactus<br/>[SmallCactus.py]"]
  node_largecactus["Large cactus<br/>[LargeCactus.py]"]
  node_capture["Image capture<br/>[ImageCapture.py]"]
end

subgraph group_ai["AI and training"]
  node_nn["Neural network<br/>[NeuralNetwork.py]"]
  node_genetic["Genetic training<br/>[Genetic.py]"]
  node_saveload[("Progress persistence<br/>[SaveLoad.py]")]
  node_tfmodel["TensorFlow model builder"]
end

subgraph group_coursework["Other exercises"]
  node_tp1a["TP1 A<br/>[tp1a.py]"]
  node_tp1b["TP1 B<br/>[tp1b.py]"]
  node_tp1c["TP1 C<br/>[tp1c.py]"]
  node_tp1d["TP1 D<br/>[tp1d.py]"]
  node_tp2j["TP2 implementation"]
  node_tp2n["TP2 implementation"]
  node_tp31["TP3 exercise 1<br/>[3.1.py]"]
  node_tp3ej2["TP3 exercise 2<br/>[Ej2.py]"]
  node_tp3model["TP3 model builder"]
end

node_player(("Game user"))

node_player -->|"chooses mode"| node_entry
node_entry -->|"updates and draws"| node_dino
node_entry -->|"updates and draws"| node_cloud
node_entry -->|"spawns and updates"| node_bird
node_entry -->|"spawns and updates"| node_smallcactus
node_entry -->|"spawns and updates"| node_largecactus
node_entry -->|"updates population"| node_genetic
node_entry -->|"captures input"| node_capture
node_dino -->|"inherits from"| node_nn
node_bird -->|"inherits from"| node_obstacle
node_smallcactus -->|"inherits from"| node_obstacle
node_largecactus -->|"inherits from"| node_obstacle
node_genetic -->|"saves and loads"| node_saveload

click node_entry "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/main.py"
click node_dino "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Dinosaur.py"
click node_cloud "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Cloud.py"
click node_obstacle "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Obstacle.py"
click node_bird "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Bird.py"
click node_smallcactus "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/SmallCactus.py"
click node_largecactus "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/LargeCactus.py"
click node_capture "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/ImageCapture.py"
click node_nn "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/NeuralNetwork.py"
click node_genetic "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Genetic.py"
click node_saveload "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/SaveLoad.py"
click node_tfmodel "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/BuildTensorflowModel.py"
click node_tp1a "https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1a.py"
click node_tp1b "https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1b.py"
click node_tp1c "https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1c.py"
click node_tp1d "https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1d.py"
click node_tp2j "https://github.com/juligassibe/tps-ia2/blob/main/TP2/implementacion%20juli.py"
click node_tp2n "https://github.com/juligassibe/tps-ia2/blob/main/TP2/implementacion_nahu.py"
click node_tp31 "https://github.com/juligassibe/tps-ia2/blob/main/TP3/3.1.py"
click node_tp3ej2 "https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej2.py"
click node_tp3model "https://github.com/juligassibe/tps-ia2/blob/main/TP3/BuildTensorflowModel.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_entry,node_dino,node_cloud,node_obstacle,node_bird,node_smallcactus,node_largecactus,node_capture,node_player toneBlue
class node_nn,node_genetic,node_saveload,node_tfmodel toneAmber
class node_tp1a,node_tp1b,node_tp1c,node_tp1d,node_tp2j,node_tp2n,node_tp31,node_tp3ej2,node_tp3model toneMint
```

## Components

### Game runtime

- [Game loop](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/main.py): `TP3/Ej3/main.py`
- [Dinosaur](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Dinosaur.py): `TP3/Ej3/Dinosaur.py`
- [Cloud](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Cloud.py): `TP3/Ej3/Cloud.py`
- [Obstacle base](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Obstacle.py): `TP3/Ej3/Obstacle.py`
- [Bird obstacle](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Bird.py): `TP3/Ej3/Bird.py`
- [Small cactus](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/SmallCactus.py): `TP3/Ej3/SmallCactus.py`
- [Large cactus](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/LargeCactus.py): `TP3/Ej3/LargeCactus.py`
- [Image capture](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/ImageCapture.py): `TP3/Ej3/ImageCapture.py`

### AI and training

- [Neural network](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/NeuralNetwork.py): `TP3/Ej3/NeuralNetwork.py`
- [Genetic training](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/Genetic.py): `TP3/Ej3/Genetic.py`
- [Progress persistence](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/SaveLoad.py): `TP3/Ej3/SaveLoad.py`
- [TensorFlow model builder](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej3/BuildTensorflowModel.py): `TP3/Ej3/BuildTensorflowModel.py`

### Other exercises

- [TP1 A](https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1a.py): `TP1/tp1a.py`
- [TP1 B](https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1b.py): `TP1/tp1b.py`
- [TP1 C](https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1c.py): `TP1/tp1c.py`
- [TP1 D](https://github.com/juligassibe/tps-ia2/blob/main/TP1/tp1d.py): `TP1/tp1d.py`
- [TP2 implementation](https://github.com/juligassibe/tps-ia2/blob/main/TP2/implementacion%20juli.py): `TP2/implementacion juli.py`
- [TP2 implementation](https://github.com/juligassibe/tps-ia2/blob/main/TP2/implementacion_nahu.py): `TP2/implementacion_nahu.py`
- [TP3 exercise 1](https://github.com/juligassibe/tps-ia2/blob/main/TP3/3.1.py): `TP3/3.1.py`
- [TP3 exercise 2](https://github.com/juligassibe/tps-ia2/blob/main/TP3/Ej2.py): `TP3/Ej2.py`
- [TP3 model builder](https://github.com/juligassibe/tps-ia2/blob/main/TP3/BuildTensorflowModel.py): `TP3/BuildTensorflowModel.py`

### Other components

- **Game user**

## Connections

- Game user → Game loop: chooses mode (evidence: `TP3/Ej3/main.py`)
- Game loop → Dinosaur: updates and draws (evidence: `TP3/Ej3/main.py`)
- Game loop → Cloud: updates and draws (evidence: `TP3/Ej3/main.py`)
- Game loop → Bird obstacle: spawns and updates (evidence: `TP3/Ej3/main.py`)
- Game loop → Small cactus: spawns and updates (evidence: `TP3/Ej3/main.py`)
- Game loop → Large cactus: spawns and updates (evidence: `TP3/Ej3/main.py`)
- Game loop → Genetic training: updates population (evidence: `TP3/Ej3/main.py`)
- Game loop → Image capture: captures input (evidence: `TP3/Ej3/main.py`)
- Dinosaur → Neural network: inherits from (evidence: `TP3/Ej3/Dinosaur.py`)
- Bird obstacle → Obstacle base: inherits from (evidence: `TP3/Ej3/Bird.py`)
- Small cactus → Obstacle base: inherits from (evidence: `TP3/Ej3/SmallCactus.py`)
- Large cactus → Obstacle base: inherits from (evidence: `TP3/Ej3/LargeCactus.py`)
- Genetic training → Progress persistence: saves and loads (evidence: `TP3/Ej3/Genetic.py`)
