# simulacionudec2026-02/simulacion_trabajofinal architecture

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

- Interactive diagram: https://gitdiagram.com/simulacionudec2026-02/simulacion_trabajofinal
- Repository: https://github.com/simulacionudec2026-02/simulacion_trabajofinal

## Overview

This repository is a Python discrete-event queueing simulator with a Streamlit configuration interface. The intended workflow is to define a scenario, validate its input contract, simulate customer arrivals and service, then validate the event result and compute queueing metrics for review. The sampled UI currently presents placeholder results and does not show a call into the engine or metrics; the engine excerpt also documents support narrower than the README’s eight variants. The graph preserves those documented capability areas without implying they are all implemented or wired together.

Main entry points: [`src/app.py`](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/app.py) (Streamlit interface), [`src/engine.py`](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/engine.py) (Customer event results), [`src/config.py`](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/config.py) (Input validation), [`src/contrato_salida.py`](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/contrato_salida.py) (Output validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit_ui["Streamlit interface<br/>[app.py]"]
end

subgraph group_scenario["Scenario definition"]
  node_input_contract["Input validation<br/>[config.py]"]
  node_topology_variants["Queue topologies<br/>[topologias.py]"]
end

subgraph group_simulation["Simulation runtime"]
  node_event_engine["Discrete-event engine<br/>[engine.py]"]
  node_event_results["Customer event results<br/>[engine.py]"]
end

subgraph group_analysis["Result analysis"]
  node_output_contract["Output validation<br/>[contrato_salida.py]"]
  node_metrics["Queueing metrics<br/>[metrics.py]"]
end

node_user(("Scenario user"))

node_user -->|"configures scenario"| node_streamlit_ui
node_streamlit_ui -->|"imports validator"| node_input_contract
node_streamlit_ui -.->|"selects variants"| node_topology_variants
node_event_engine -->|"validates input"| node_input_contract
node_event_engine -->|"produces events"| node_event_results
node_output_contract -->|"checks against config"| node_input_contract
node_event_results -->|"validates result"| node_output_contract
node_event_results -->|"calculates metrics from"| node_metrics
node_metrics -.->|"displays results"| node_streamlit_ui

click node_streamlit_ui "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/app.py"
click node_input_contract "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/config.py"
click node_topology_variants "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/topologias.py"
click node_event_engine "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/engine.py"
click node_event_results "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/engine.py"
click node_output_contract "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/contrato_salida.py"
click node_metrics "https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/metrics.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_streamlit_ui,node_user toneBlue
class node_input_contract,node_topology_variants toneAmber
class node_event_engine,node_event_results toneMint
class node_output_contract,node_metrics toneRose
```

## Components

### User interface

- [Streamlit interface](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/app.py): `src/app.py`

### Scenario definition

- [Input validation](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/config.py): `src/config.py`
- [Queue topologies](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/topologias.py): `src/topologias.py`

### Simulation runtime

- [Discrete-event engine](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/engine.py): `src/engine.py`
- [Customer event results](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/engine.py): `src/engine.py`

### Result analysis

- [Output validation](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/contrato_salida.py): `src/contrato_salida.py`
- [Queueing metrics](https://github.com/simulacionudec2026-02/simulacion_trabajofinal/blob/main/src/metrics.py): `src/metrics.py`

### Other components

- **Scenario user**

## Connections

- Scenario user → Streamlit interface: configures scenario (evidence: `README.md`)
- Streamlit interface → Input validation: imports validator (evidence: `src/app.py`)
- Streamlit interface → Queue topologies: selects variants
- Discrete-event engine → Input validation: validates input (evidence: `src/engine.py`)
- Discrete-event engine → Customer event results: produces events (evidence: `src/engine.py`)
- Output validation → Input validation: checks against config (evidence: `src/contrato_salida.py`)
- Customer event results → Output validation: validates result (evidence: `src/contrato_salida.py`)
- Customer event results → Queueing metrics: calculates metrics from (evidence: `src/metrics.py`)
- Queueing metrics → Streamlit interface: displays results
