# aneprados/examen_extraordinaria architecture

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

- Interactive diagram: https://gitdiagram.com/aneprados/examen_extraordinaria
- Repository: https://github.com/aneprados/examen_extraordinaria

## Overview

##### Project type and purpose
- This is a standalone, command-line planetary system simulator written in Python.
- It models bodies in 3D space, computes gravitational interactions, advances simulation steps, and persists state (JSON/CSV).

##### File structure
- Top-level Python modules:
- Domain/model: `Clase_vector_3D.py`, `Cuerpos_celestes.py`
- Core logic: `Simulador.py`
- CLI interface: `Lanzador.py`, `main.py`
- Alternate implementation: `nose.py` (alternative `Vector3D`)
- Tests: `Pruebas_unitarias.py`, `Pruebas_cuerpo.py`, `Pruebas_del_simulador.py`
- No web frontend or separate “backend” service—everything runs in one process.
- Persistence handled inside `Simulador` (JSON/CSV).

##### README for additional insights
- Dependencies: Python ≥3.10, `pytest`
- Simulation features, persistence formats, interactive menu
- No external services or databases

##### Main components & their relationships
a. Domain layer
- Vector3D class (vector operations)
- CuerpoCeleste class (mass, position, velocity, energy, apply forces)
b. Simulation engine
- Simulador class: orchestrates N-body computation, time steps, uses Domain classes, handles persistence
c. Presentation/CLI
- Lanzador: command parsing, invokes Simulador methods
- main: entry point, initializes Simulador & Lanzador, starts interactive loop
d. Persistence
- JSON/CSV readers & writers embedded in Simulador
e. Tests
- Three test modules depending on each core class

##### Architectural patterns & design principles
- Layered architecture (Presentation → Application/Engine → Domain → Infrastructure)
- Single responsibility: each class has a focused role (vector math, celestial body, engine, CLI)
- Dependency direction: upper layers (CLI/tests) depend on lower layers (engine, domain)

##### Detail without over-splitting
- Both the computational flow (Vector → Body → Simulator → CLI) and data persistence paths
- Test suites hooking into each component

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Tests Layer"
        TU["Pruebas_unitarias.py"]:::test
        TC["Pruebas_cuerpo.py"]:::test
        TS["Pruebas_del_simulador.py"]:::test
    end

    subgraph "CLI Layer"
        MAIN["main.py\n(Entry Point)"]:::cli
        LAUN["Lanzador.py\n(CLI Launcher)"]:::cli
    end

    subgraph "Simulation Engine"
        SIM["Simulador.py\n(Simulation Engine\n+ Persistence I/O)"]:::engine
    end

    subgraph "Domain & Persistence Layer"
        VEC["Clase_vector_3D.py\n(Vector3D)"]:::domain
        ALT["nose.py\n(Alt Vector3D)"]:::domain
        CUE["Cuerpos_celestes.py\n(CuerpoCeleste)"]:::domain
    end

    SIM -->|"uses"| VEC
    SIM -->|"uses"| CUE
    CUE -->|"uses"| VEC
    LAUN -->|"invokes"| SIM
    MAIN -->|"calls"| LAUN
    MAIN -->|"inits"| SIM
    TU -->|"tests"| VEC
    TC -->|"tests"| CUE
    TS -->|"tests"| SIM

    click VEC "https://github.com/aneprados/examen_extraordinaria/blob/main/Clase_vector_3D.py"
    click ALT "https://github.com/aneprados/examen_extraordinaria/blob/main/nose.py"
    click CUE "https://github.com/aneprados/examen_extraordinaria/blob/main/Cuerpos_celestes.py"
    click SIM "https://github.com/aneprados/examen_extraordinaria/blob/main/Simulador.py"
    click LAUN "https://github.com/aneprados/examen_extraordinaria/blob/main/Lanzador.py"
    click MAIN "https://github.com/aneprados/examen_extraordinaria/blob/main/main.py"
    click TU "https://github.com/aneprados/examen_extraordinaria/blob/main/Pruebas_unitarias.py"
    click TC "https://github.com/aneprados/examen_extraordinaria/blob/main/Pruebas_cuerpo.py"
    click TS "https://github.com/aneprados/examen_extraordinaria/blob/main/Pruebas_del_simulador.py"

    classDef test fill:#d3d3d3,stroke:#888;
    classDef cli fill:#ffcc99,stroke:#e67300;
    classDef engine fill:#ccffcc,stroke:#33cc33;
    classDef domain fill:#cce5ff,stroke:#3399ff;
```
