# anagainaru/scheduleflow architecture

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

- Interactive diagram: https://gitdiagram.com/anagainaru/scheduleflow
- Repository: https://github.com/anagainaru/scheduleflow

## Overview

ScheduleFlow is a Python simulator for online and reservation-based HPC batch schedulers. Users create jobs and a system, provide a scheduler, and run a scenario; the runtime processes events and invokes scheduling, producing an execution log that can be checked, summarized, or visualized. The main API and internal engine are both implemented in two files, so several domain responsibilities share those paths. The excerpts show key calls, but not enough detail to map every scheduling policy or reservation operation.

Main entry points: [`ScheduleFlow.py`](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py) (Simulation API), [`_intScheduleFlow.py`](https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py) (Event runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Simulation API"]
  node_simulation["Simulation API<br/>[ScheduleFlow.py]"]
  node_scenario["Scenario setup<br/>[ScheduleFlow.py]"]
end

subgraph group_domain["Workload Model"]
  node_job["Job model<br/>[ScheduleFlow.py]"]
  node_system["Compute system<br/>[ScheduleFlow.py]"]
end

subgraph group_engine["Scheduling Engine"]
  node_scheduler["Batch scheduler<br/>[ScheduleFlow.py]"]
  node_runtime["Event runtime"]
  node_event_queue["Event queue"]
  node_schedule_gaps["Reservation gaps"]
end

subgraph group_results["Results"]
  node_execution_log["Execution log<br/>[ScheduleFlow.py]"]
  node_stats["Statistics"]
  node_visualization["GIF and JPG output"]
end

node_user(("Simulation user"))

node_user -->|"configures"| node_simulation
node_simulation -->|"creates"| node_scenario
node_scenario -->|"runs"| node_runtime
node_scenario -->|"adds jobs"| node_job
node_scenario -->|"sets scheduler"| node_scheduler
node_job -->|"assigns to"| node_system
node_runtime -->|"creates events"| node_event_queue
node_runtime -->|"triggers schedule"| node_scheduler
node_runtime -.->|"records executions"| node_execution_log
node_simulation -->|"computes metrics"| node_stats
node_simulation -->|"generates output"| node_visualization
node_scheduler -.->|"uses reservations"| node_schedule_gaps

click node_simulation "https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py"
click node_scenario "https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py"
click node_job "https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py"
click node_system "https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py"
click node_scheduler "https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py"
click node_runtime "https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py"
click node_event_queue "https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py"
click node_schedule_gaps "https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py"
click node_execution_log "https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py"
click node_stats "https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py"
click node_visualization "https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.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_simulation,node_scenario,node_user toneBlue
class node_job,node_system toneAmber
class node_scheduler,node_runtime,node_event_queue,node_schedule_gaps toneMint
class node_execution_log,node_stats,node_visualization toneRose
```

## Components

### Simulation API

- [Simulation API](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py): `ScheduleFlow.py`
- [Scenario setup](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py): `ScheduleFlow.py`

### Workload Model

- [Job model](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py): `ScheduleFlow.py`
- [Compute system](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py): `ScheduleFlow.py`

### Scheduling Engine

- [Batch scheduler](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py): `ScheduleFlow.py`
- [Event runtime](https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py): `_intScheduleFlow.py`
- [Event queue](https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py): `_intScheduleFlow.py`
- [Reservation gaps](https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py): `_intScheduleFlow.py`

### Results

- [Execution log](https://github.com/anagainaru/scheduleflow/blob/master/ScheduleFlow.py): `ScheduleFlow.py`
- [Statistics](https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py): `_intScheduleFlow.py`
- [GIF and JPG output](https://github.com/anagainaru/scheduleflow/blob/master/_intScheduleFlow.py): `_intScheduleFlow.py`

### Other components

- **Simulation user**

## Connections

- Simulation user → Simulation API: configures (evidence: `README.md`)
- Simulation API → Scenario setup: creates (evidence: `ScheduleFlow.py`)
- Scenario setup → Event runtime: runs (evidence: `ScheduleFlow.py`)
- Scenario setup → Job model: adds jobs (evidence: `ScheduleFlow.py`)
- Scenario setup → Batch scheduler: sets scheduler (evidence: `README.md`)
- Job model → Compute system: assigns to (evidence: `ScheduleFlow.py`)
- Event runtime → Event queue: creates events (evidence: `_intScheduleFlow.py`)
- Event runtime → Batch scheduler: triggers schedule (evidence: `_intScheduleFlow.py`)
- Event runtime → Execution log: records executions (evidence: `ScheduleFlow.py`)
- Simulation API → Statistics: computes metrics (evidence: `ScheduleFlow.py`)
- Simulation API → GIF and JPG output: generates output (evidence: `ScheduleFlow.py`)
- Batch scheduler → Reservation gaps: uses reservations (evidence: `ScheduleFlow.py`)
