# jmpromm/cs3502-p2-cpu-scheduler architecture

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

- Interactive diagram: https://gitdiagram.com/jmpromm/cs3502-p2-cpu-scheduler
- Repository: https://github.com/jmpromm/cs3502-p2-cpu-scheduler

## Overview

This is a console CPU scheduling simulator comparing six algorithms across generated CPU-bound, I/O-bound, and mixed workloads. The principal workflow creates or selects a workload, runs each scheduler, calculates performance metrics, and presents and exports results; a separate charting script turns the summary CSV into plots. The graph follows relationships visible in the excerpts and README. It does not infer internal details of unsampled code, such as the chart script’s runtime relationship to the simulator.

Main entry points: [`main.py`](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/main.py) (CLI and experiments), [`schedulers.py`](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/schedulers.py) (Algorithm suite), [`export_results.py`](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/export_results.py) (CSV export), [`make_charts.py`](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/make_charts.py) (Chart generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Simulation workflow"]
  node_cli["CLI and experiments<br/>[main.py]"]
  node_workload["Workload generation<br/>[workloads.py]"]
end

subgraph group_engine["Scheduling engine"]
  node_process["Process model<br/>[process_model.py]"]
  node_scheduler["Algorithm suite<br/>[schedulers.py]"]
  node_metrics["Performance metrics<br/>[metrics.py]"]
end

subgraph group_outputs["Results and charts"]
  node_display["Console summaries<br/>[main.py]"]
  node_export["CSV export<br/>[export_results.py]"]
  node_csv["Results CSV files"]
  node_charts["Chart generation<br/>[make_charts.py]"]
  node_chartfiles["Chart images"]
end

node_user(("Console user"))

node_user -->|"runs"| node_cli
node_cli -->|"generates"| node_workload
node_cli -->|"runs all"| node_scheduler
node_workload -->|"creates"| node_process
node_scheduler -->|"copies and updates"| node_process
node_scheduler -->|"calculates"| node_metrics
node_cli -->|"prints"| node_display
node_cli -->|"collects and writes"| node_export
node_export -->|"reads results"| node_scheduler
node_export -->|"writes"| node_csv
node_charts -->|"reads"| node_csv
node_charts -->|"saves"| node_chartfiles

click node_cli "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/main.py"
click node_workload "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/workloads.py"
click node_process "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/process_model.py"
click node_scheduler "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/schedulers.py"
click node_metrics "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/metrics.py"
click node_display "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/main.py"
click node_export "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/export_results.py"
click node_csv "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/tree/main/results"
click node_charts "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/make_charts.py"
click node_chartfiles "https://github.com/jmpromm/cs3502-p2-cpu-scheduler/tree/main/report/charts"

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_cli,node_workload,node_user toneBlue
class node_process,node_scheduler,node_metrics toneAmber
class node_display,node_export,node_csv,node_charts,node_chartfiles toneMint
```

## Components

### Simulation workflow

- [CLI and experiments](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/main.py): `main.py`
- [Workload generation](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/workloads.py): `workloads.py`

### Scheduling engine

- [Process model](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/process_model.py): `process_model.py`
- [Algorithm suite](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/schedulers.py): `schedulers.py`
- [Performance metrics](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/metrics.py): `metrics.py`

### Results and charts

- [Console summaries](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/main.py): `main.py`
- [CSV export](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/export_results.py): `export_results.py`
- [Results CSV files](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/tree/main/results): `results`
- [Chart generation](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/blob/main/make_charts.py): `make_charts.py`
- [Chart images](https://github.com/jmpromm/cs3502-p2-cpu-scheduler/tree/main/report/charts): `report/charts`

### Other components

- **Console user**

## Connections

- Console user → CLI and experiments: runs (evidence: `README.md`)
- CLI and experiments → Workload generation: generates (evidence: `main.py`)
- CLI and experiments → Algorithm suite: runs all (evidence: `main.py`)
- Workload generation → Process model: creates (evidence: `workloads.py`)
- Algorithm suite → Process model: copies and updates (evidence: `schedulers.py`)
- Algorithm suite → Performance metrics: calculates (evidence: `schedulers.py`)
- CLI and experiments → Console summaries: prints (evidence: `main.py`)
- CLI and experiments → CSV export: collects and writes (evidence: `main.py`)
- CSV export → Algorithm suite: reads results (evidence: `export_results.py`)
- CSV export → Results CSV files: writes
- Chart generation → Results CSV files: reads (evidence: `make_charts.py`)
- Chart generation → Chart images: saves (evidence: `make_charts.py`)
