# petros-pap/stochos architecture

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

- Interactive diagram: https://gitdiagram.com/petros-pap/stochos
- Repository: https://github.com/petros-pap/stochos

## Overview

STOCHOS is research code for stochastic maintenance scheduling at offshore wind farms. The documented user workflow is to obtain optimization-solution JSON files and use the supplied notebook to view preliminary results. The main Python module also contains optimization, scenario-generation, rolling-horizon, and analysis responsibilities. The excerpts show the rolling-horizon solver calling the data loader; other internal links are omitted where excerpts do not establish them. The notebook and external solution files are documented, but their implementation details are not sampled.

Main entry points: [`IISE_paper_figures.ipynb`](https://github.com/petros-pap/stochos/blob/master/IISE_paper_figures.ipynb) (Preliminary result figures), [`STOCHOS.py`](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py) (Rolling-horizon solver), [`Sobol.py`](https://github.com/petros-pap/stochos/blob/master/Sobol.py) (Sobol sampling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Scheduling model"]
  node_rh_solver["Rolling-horizon solver<br/>[STOCHOS.py]"]
  node_optimization["Maintenance optimizer<br/>[STOCHOS.py]"]
end

subgraph group_uncertainty["Uncertainty scenarios"]
  node_data_loader["Scenario data loader<br/>[STOCHOS.py]"]
  node_scenario_gen["Forecast scenario generation<br/>[STOCHOS.py]"]
  node_ridge["Ridge regression<br/>[STOCHOS.py]"]
  node_sobol["Sobol sampling<br/>[Sobol.py]"]
end

subgraph group_analysis["Results analysis"]
  node_figures["Preliminary result figures"]
  node_revenue["Revenue analysis<br/>[STOCHOS.py]"]
end

node_analyst(("Researcher"))
node_solutions["Solution JSON files"]

node_analyst -->|"views results"| node_figures
node_solutions -->|"loads solutions"| node_figures
node_rh_solver -->|"calls"| node_data_loader
node_optimization -.->|"uses"| node_sobol

click node_rh_solver "https://github.com/petros-pap/stochos/blob/master/STOCHOS.py"
click node_optimization "https://github.com/petros-pap/stochos/blob/master/STOCHOS.py"
click node_data_loader "https://github.com/petros-pap/stochos/blob/master/STOCHOS.py"
click node_scenario_gen "https://github.com/petros-pap/stochos/blob/master/STOCHOS.py"
click node_ridge "https://github.com/petros-pap/stochos/blob/master/STOCHOS.py"
click node_sobol "https://github.com/petros-pap/stochos/blob/master/Sobol.py"
click node_figures "https://github.com/petros-pap/stochos/blob/master/IISE_paper_figures.ipynb"
click node_revenue "https://github.com/petros-pap/stochos/blob/master/STOCHOS.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_rh_solver,node_optimization toneBlue
class node_data_loader,node_scenario_gen,node_ridge,node_sobol toneAmber
class node_figures,node_revenue toneMint
class node_analyst,node_solutions toneIndigo
```

## Components

### Scheduling model

- [Rolling-horizon solver](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py): `STOCHOS.py`
- [Maintenance optimizer](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py): `STOCHOS.py`

### Uncertainty scenarios

- [Scenario data loader](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py): `STOCHOS.py`
- [Forecast scenario generation](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py): `STOCHOS.py`
- [Ridge regression](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py): `STOCHOS.py`
- [Sobol sampling](https://github.com/petros-pap/stochos/blob/master/Sobol.py): `Sobol.py`

### Results analysis

- [Preliminary result figures](https://github.com/petros-pap/stochos/blob/master/IISE_paper_figures.ipynb): `IISE_paper_figures.ipynb`
- [Revenue analysis](https://github.com/petros-pap/stochos/blob/master/STOCHOS.py): `STOCHOS.py`

### Other components

- **Researcher**
- **Solution JSON files**

## Connections

- Researcher → Preliminary result figures: views results (evidence: `README.md`)
- Solution JSON files → Preliminary result figures: loads solutions (evidence: `README.md`)
- Rolling-horizon solver → Scenario data loader: calls (evidence: `STOCHOS.py`)
- Maintenance optimizer → Sobol sampling: uses (evidence: `STOCHOS.py`)
