# pierrelux/rlbook architecture

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

- Interactive diagram: https://gitdiagram.com/pierrelux/rlbook
- Repository: https://github.com/pierrelux/rlbook

## Overview

RL & Control is the source for an educational book: readers move from dynamics and control concepts to sequential decision-making and learning applications, with executed examples and selected browser demonstrations. The repository also contains a curated JupyterLite lab and a broad set of domain experiments. The README documents the book/lab workflow and several experiment capabilities; source excerpts and the index support only a few internal call relationships, so the graph leaves other example connections unstated.

Main entry points: [`code/thermal_recovery.py`](https://github.com/pierrelux/rlbook/blob/main/code/thermal_recovery.py) (Thermal recovery), [`lab`](https://github.com/pierrelux/rlbook/tree/main/lab) (JupyterLite lab), [`code/swing_ppo.py`](https://github.com/pierrelux/rlbook/blob/main/code/swing_ppo.py) (Swing PPO), [`code/inference_control.py`](https://github.com/pierrelux/rlbook/blob/main/code/inference_control.py) (Inference control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning methods"]
  node_swing_ppo["Swing PPO<br/>[swing_ppo.py]"]
end

subgraph group_control["Control methods"]
  node_swing_control["Swing controller<br/>[swing_control.py]"]
  node_cubesat_planning["CubeSat planning"]
  node_trajectory_optimization["Trajectory optimization"]
  node_thermal_control["Thermal control<br/>[thermal_control.py]"]
  node_mppi["MPPI control<br/>[mppi_control.py]"]
end

subgraph group_applications["Applications"]
  node_inference_control["Inference control"]
  node_inference_plant["Inference serving plant"]
  node_inference_replay["Inference replays"]
  node_thermal_recovery["Thermal recovery"]
  node_thermal_plant["Thermal reactor<br/>[thermal_reactor.py]"]
  node_thermal_plume["Thermal plume<br/>[thermal_plume.py]"]
  node_radiotherapy["Radiotherapy decisions"]
  node_sailing["Sailing control"]
  node_bridge_maintenance["Bridge maintenance"]
end

subgraph group_booklab["Book and lab"]
  node_book["RL &amp; Control book"]
  node_lab["JupyterLite lab"]
  node_notebook_generator["Notebook generator"]
  node_interactive_replays["Browser replays"]
end

node_reader(("Reader"))

node_reader -->|"studies"| node_book
node_reader -->|"uses"| node_lab
node_notebook_generator -->|"generates notebooks"| node_lab
node_book -->|"includes demonstrations"| node_interactive_replays
node_inference_control -->|"uses simulator"| node_inference_plant
node_thermal_recovery -->|"uses model"| node_thermal_plant
node_thermal_recovery -->|"uses model"| node_thermal_plume
node_swing_ppo -->|"reuses controller"| node_swing_control

click node_lab "https://github.com/pierrelux/rlbook/tree/main/lab"
click node_notebook_generator "https://github.com/pierrelux/rlbook/blob/main/lab/generate_notebooks.py"
click node_interactive_replays "https://github.com/pierrelux/rlbook/tree/main/interactive"
click node_inference_control "https://github.com/pierrelux/rlbook/blob/main/code/inference_control.py"
click node_inference_plant "https://github.com/pierrelux/rlbook/blob/main/code/inference_serving.py"
click node_inference_replay "https://github.com/pierrelux/rlbook/blob/main/code/inference_replay.py"
click node_thermal_recovery "https://github.com/pierrelux/rlbook/blob/main/code/thermal_recovery.py"
click node_thermal_plant "https://github.com/pierrelux/rlbook/blob/main/code/thermal_reactor.py"
click node_thermal_plume "https://github.com/pierrelux/rlbook/blob/main/code/thermal_plume.py"
click node_swing_control "https://github.com/pierrelux/rlbook/blob/main/code/swing_control.py"
click node_swing_ppo "https://github.com/pierrelux/rlbook/blob/main/code/swing_ppo.py"
click node_cubesat_planning "https://github.com/pierrelux/rlbook/blob/main/code/cubesat_differential_drag.py"
click node_trajectory_optimization "https://github.com/pierrelux/rlbook/blob/main/code/trajectory_optimization.py"
click node_radiotherapy "https://github.com/pierrelux/rlbook/blob/main/code/radiotherapy_fractionation.py"
click node_sailing "https://github.com/pierrelux/rlbook/blob/main/code/sailing_wind_shifts.py"
click node_bridge_maintenance "https://github.com/pierrelux/rlbook/blob/main/code/bridge_deck_maintenance.py"
click node_thermal_control "https://github.com/pierrelux/rlbook/blob/main/code/thermal_control.py"
click node_mppi "https://github.com/pierrelux/rlbook/blob/main/code/mppi_control.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_swing_ppo toneBlue
class node_swing_control,node_cubesat_planning,node_trajectory_optimization,node_thermal_control,node_mppi toneAmber
class node_inference_control,node_inference_plant,node_inference_replay,node_thermal_recovery,node_thermal_plant,node_thermal_plume,node_radiotherapy,node_sailing,node_bridge_maintenance toneMint
class node_book,node_lab,node_notebook_generator,node_interactive_replays toneRose
class node_reader toneIndigo
```

## Components

### Learning methods

- [Swing PPO](https://github.com/pierrelux/rlbook/blob/main/code/swing_ppo.py): `code/swing_ppo.py`

### Control methods

- [Swing controller](https://github.com/pierrelux/rlbook/blob/main/code/swing_control.py): `code/swing_control.py`
- [CubeSat planning](https://github.com/pierrelux/rlbook/blob/main/code/cubesat_differential_drag.py): `code/cubesat_differential_drag.py`
- [Trajectory optimization](https://github.com/pierrelux/rlbook/blob/main/code/trajectory_optimization.py): `code/trajectory_optimization.py`
- [Thermal control](https://github.com/pierrelux/rlbook/blob/main/code/thermal_control.py): `code/thermal_control.py`
- [MPPI control](https://github.com/pierrelux/rlbook/blob/main/code/mppi_control.py): `code/mppi_control.py`

### Applications

- [Inference control](https://github.com/pierrelux/rlbook/blob/main/code/inference_control.py): `code/inference_control.py`
- [Inference serving plant](https://github.com/pierrelux/rlbook/blob/main/code/inference_serving.py): `code/inference_serving.py`
- [Inference replays](https://github.com/pierrelux/rlbook/blob/main/code/inference_replay.py): `code/inference_replay.py`
- [Thermal recovery](https://github.com/pierrelux/rlbook/blob/main/code/thermal_recovery.py): `code/thermal_recovery.py`
- [Thermal reactor](https://github.com/pierrelux/rlbook/blob/main/code/thermal_reactor.py): `code/thermal_reactor.py`
- [Thermal plume](https://github.com/pierrelux/rlbook/blob/main/code/thermal_plume.py): `code/thermal_plume.py`
- [Radiotherapy decisions](https://github.com/pierrelux/rlbook/blob/main/code/radiotherapy_fractionation.py): `code/radiotherapy_fractionation.py`
- [Sailing control](https://github.com/pierrelux/rlbook/blob/main/code/sailing_wind_shifts.py): `code/sailing_wind_shifts.py`
- [Bridge maintenance](https://github.com/pierrelux/rlbook/blob/main/code/bridge_deck_maintenance.py): `code/bridge_deck_maintenance.py`

### Book and lab

- **RL & Control book**
- [JupyterLite lab](https://github.com/pierrelux/rlbook/tree/main/lab): `lab`
- [Notebook generator](https://github.com/pierrelux/rlbook/blob/main/lab/generate_notebooks.py): `lab/generate_notebooks.py`
- [Browser replays](https://github.com/pierrelux/rlbook/tree/main/interactive): `interactive`

### Other components

- **Reader**

## Connections

- Reader → RL & Control book: studies (evidence: `README.md`)
- Reader → JupyterLite lab: uses (evidence: `README.md`)
- Notebook generator → JupyterLite lab: generates notebooks (evidence: `README.md`)
- RL & Control book → Browser replays: includes demonstrations (evidence: `README.md`)
- Inference control → Inference serving plant: uses simulator (evidence: `code/inference_control.py`)
- Thermal recovery → Thermal reactor: uses model (evidence: `code/thermal_recovery.py`)
- Thermal recovery → Thermal plume: uses model (evidence: `code/thermal_recovery.py`)
- Swing PPO → Swing controller: reuses controller (evidence: `code/swing_ppo.py`)
