# xiangjiexiao/resched architecture

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

- Interactive diagram: https://gitdiagram.com/xiangjiexiao/resched
- Repository: https://github.com/xiangjiexiao/resched

## Overview

ReSched is a reinforcement-learning application for JSSP, FJSP and FFSP scheduling, with PPO and REINFORCE implementations. A user selects an algorithm and problem configuration, then runs training or pretrained-model evaluation; the runner coordinates the environment, policy, trainer and evaluator. The environment represents scheduling state and executes actions, while generators and configured datasets supply instances. CP-SAT is an optional baseline. Relationships below follow README statements and SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`PPO/SchedulingRunner.py`](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingRunner.py) (PPO runner), [`REINFORCE/SchedulingRunner.py`](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingRunner.py) (REINFORCE runner), [`PPO/SchedulingEvaluator.py`](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingEvaluator.py) (PPO evaluator), [`PPO/cp_sat.py`](https://github.com/xiangjiexiao/resched/blob/main/PPO/cp_sat.py) (PPO CP-SAT)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Experiment entry"]
  node_ppo_main["PPO entry<br/>[SchedulingMain.py]"]
  node_reinforce_main["REINFORCE entry<br/>[SchedulingMain.py]"]
  node_ppo_config["PPO configs"]
  node_reinforce_config["REINFORCE configs"]
end

subgraph group_ppo["PPO workflow"]
  node_ppo_runner["PPO runner"]
  node_ppo_model["PPO policy<br/>[SchedulingModel.py]"]
  node_ppo_trainer["PPO trainer<br/>[PPOTrainer.py]"]
  node_ppo_evaluator["PPO evaluator"]
end

subgraph group_reinforce["REINFORCE workflow"]
  node_reinforce_runner["REINFORCE runner"]
  node_reinforce_model["REINFORCE policy<br/>[SchedulingModel.py]"]
  node_reinforce_trainer["REINFORCE trainer"]
  node_reinforce_evaluator["REINFORCE evaluator"]
end

subgraph group_problem["Scheduling domain"]
  node_ppo_env["PPO environment"]
  node_reinforce_env["REINFORCE environment"]
  node_ppo_generator["PPO generators"]
  node_ppo_sd1["PPO SD1 generator"]
  node_reinforce_generator["REINFORCE generators"]
  node_reinforce_sd1["REINFORCE SD1 generator"]
  node_ppo_cp["PPO CP-SAT<br/>[cp_sat.py]"]
  node_reinforce_cp["REINFORCE CP-SAT<br/>[cp_sat.py]"]
end

subgraph group_resources["Data and baselines"]
  node_ppo_utils["PPO utilities<br/>[utils.py]"]
  node_reinforce_utils["REINFORCE utilities<br/>[utils.py]"]
  node_datasets[("Problem datasets")]
  node_checkpoints[("Model checkpoints")]
end

node_user(("Experiment user"))

node_user -->|"runs"| node_ppo_main
node_user -->|"runs"| node_reinforce_main
node_ppo_main -->|"starts"| node_ppo_runner
node_reinforce_main -->|"starts"| node_reinforce_runner
node_ppo_main -->|"selects"| node_ppo_config
node_reinforce_main -->|"selects"| node_reinforce_config
node_ppo_runner -->|"initializes"| node_ppo_env
node_ppo_runner -->|"creates"| node_ppo_model
node_ppo_runner -->|"creates"| node_ppo_trainer
node_ppo_runner -->|"uses"| node_ppo_evaluator
node_ppo_runner -->|"calls"| node_ppo_utils
node_ppo_trainer -->|"evaluates policy"| node_ppo_model
node_ppo_trainer -->|"uses"| node_ppo_utils
node_ppo_evaluator -->|"evaluates policy"| node_ppo_model
node_ppo_evaluator -->|"uses"| node_ppo_utils
node_ppo_env -->|"constructs"| node_ppo_generator
node_ppo_env -->|"constructs"| node_ppo_sd1
node_ppo_cp -->|"uses"| node_ppo_generator
node_ppo_cp -->|"uses"| node_ppo_sd1
node_reinforce_runner -->|"initializes"| node_reinforce_env
node_reinforce_runner -->|"creates"| node_reinforce_model
node_reinforce_runner -->|"creates"| node_reinforce_trainer
node_reinforce_runner -->|"uses"| node_reinforce_evaluator
node_reinforce_runner -->|"calls"| node_reinforce_utils
node_reinforce_trainer -->|"evaluates policy"| node_reinforce_model
node_reinforce_evaluator -->|"evaluates policy"| node_reinforce_model
node_reinforce_env -->|"constructs"| node_reinforce_generator
node_reinforce_env -->|"constructs"| node_reinforce_sd1
node_reinforce_cp -->|"uses"| node_reinforce_generator
node_reinforce_cp -->|"uses"| node_reinforce_sd1
node_ppo_config -->|"configures loading"| node_datasets
node_reinforce_config -->|"configures loading"| node_datasets
node_ppo_runner -->|"loads or saves"| node_checkpoints
node_reinforce_runner -->|"loads or saves"| node_checkpoints
node_ppo_cp -.->|"baseline comparison"| node_ppo_evaluator
node_reinforce_cp -.->|"baseline comparison"| node_reinforce_evaluator

click node_ppo_main "https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingMain.py"
click node_reinforce_main "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingMain.py"
click node_ppo_config "https://github.com/xiangjiexiao/resched/tree/main/PPO/configs"
click node_reinforce_config "https://github.com/xiangjiexiao/resched/tree/main/REINFORCE/configs"
click node_ppo_runner "https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingRunner.py"
click node_ppo_model "https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingModel.py"
click node_ppo_trainer "https://github.com/xiangjiexiao/resched/blob/main/PPO/PPOTrainer.py"
click node_ppo_evaluator "https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingEvaluator.py"
click node_reinforce_runner "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingRunner.py"
click node_reinforce_model "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingModel.py"
click node_reinforce_trainer "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/REINFORCETrainer.py"
click node_reinforce_evaluator "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingEvaluator.py"
click node_ppo_env "https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingEnvironment.py"
click node_reinforce_env "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingEnvironment.py"
click node_ppo_generator "https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingGenerator.py"
click node_ppo_sd1 "https://github.com/xiangjiexiao/resched/blob/main/PPO/SD1FJSPGenerator.py"
click node_reinforce_generator "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingGenerator.py"
click node_reinforce_sd1 "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SD1FJSPGenerator.py"
click node_ppo_cp "https://github.com/xiangjiexiao/resched/blob/main/PPO/cp_sat.py"
click node_reinforce_cp "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/cp_sat.py"
click node_ppo_utils "https://github.com/xiangjiexiao/resched/blob/main/PPO/utils.py"
click node_reinforce_utils "https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/utils.py"
click node_datasets "https://github.com/xiangjiexiao/resched/tree/main/data"
click node_checkpoints "https://github.com/xiangjiexiao/resched/tree/main/ckpt"

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_ppo_main,node_reinforce_main,node_ppo_config,node_reinforce_config,node_user toneBlue
class node_ppo_runner,node_ppo_model,node_ppo_trainer,node_ppo_evaluator toneAmber
class node_reinforce_runner,node_reinforce_model,node_reinforce_trainer,node_reinforce_evaluator toneMint
class node_ppo_env,node_reinforce_env,node_ppo_generator,node_ppo_sd1,node_reinforce_generator,node_reinforce_sd1,node_ppo_cp,node_reinforce_cp toneRose
class node_ppo_utils,node_reinforce_utils,node_datasets,node_checkpoints toneIndigo
```

## Components

### Experiment entry

- [PPO entry](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingMain.py): `PPO/SchedulingMain.py`
- [REINFORCE entry](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingMain.py): `REINFORCE/SchedulingMain.py`
- [PPO configs](https://github.com/xiangjiexiao/resched/tree/main/PPO/configs): `PPO/configs`
- [REINFORCE configs](https://github.com/xiangjiexiao/resched/tree/main/REINFORCE/configs): `REINFORCE/configs`

### PPO workflow

- [PPO runner](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingRunner.py): `PPO/SchedulingRunner.py`
- [PPO policy](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingModel.py): `PPO/SchedulingModel.py`
- [PPO trainer](https://github.com/xiangjiexiao/resched/blob/main/PPO/PPOTrainer.py): `PPO/PPOTrainer.py`
- [PPO evaluator](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingEvaluator.py): `PPO/SchedulingEvaluator.py`

### REINFORCE workflow

- [REINFORCE runner](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingRunner.py): `REINFORCE/SchedulingRunner.py`
- [REINFORCE policy](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingModel.py): `REINFORCE/SchedulingModel.py`
- [REINFORCE trainer](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/REINFORCETrainer.py): `REINFORCE/REINFORCETrainer.py`
- [REINFORCE evaluator](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingEvaluator.py): `REINFORCE/SchedulingEvaluator.py`

### Scheduling domain

- [PPO environment](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingEnvironment.py): `PPO/SchedulingEnvironment.py`
- [REINFORCE environment](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingEnvironment.py): `REINFORCE/SchedulingEnvironment.py`
- [PPO generators](https://github.com/xiangjiexiao/resched/blob/main/PPO/SchedulingGenerator.py): `PPO/SchedulingGenerator.py`
- [PPO SD1 generator](https://github.com/xiangjiexiao/resched/blob/main/PPO/SD1FJSPGenerator.py): `PPO/SD1FJSPGenerator.py`
- [REINFORCE generators](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SchedulingGenerator.py): `REINFORCE/SchedulingGenerator.py`
- [REINFORCE SD1 generator](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/SD1FJSPGenerator.py): `REINFORCE/SD1FJSPGenerator.py`
- [PPO CP-SAT](https://github.com/xiangjiexiao/resched/blob/main/PPO/cp_sat.py): `PPO/cp_sat.py`
- [REINFORCE CP-SAT](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/cp_sat.py): `REINFORCE/cp_sat.py`

### Data and baselines

- [PPO utilities](https://github.com/xiangjiexiao/resched/blob/main/PPO/utils.py): `PPO/utils.py`
- [REINFORCE utilities](https://github.com/xiangjiexiao/resched/blob/main/REINFORCE/utils.py): `REINFORCE/utils.py`
- [Problem datasets](https://github.com/xiangjiexiao/resched/tree/main/data): `data`
- [Model checkpoints](https://github.com/xiangjiexiao/resched/tree/main/ckpt): `ckpt`

### Other components

- **Experiment user**

## Connections

- Experiment user → PPO entry: runs (evidence: `README.md`)
- Experiment user → REINFORCE entry: runs (evidence: `README.md`)
- PPO entry → PPO runner: starts (evidence: `PPO/SchedulingMain.py`)
- REINFORCE entry → REINFORCE runner: starts (evidence: `REINFORCE/SchedulingMain.py`)
- PPO entry → PPO configs: selects (evidence: `README.md`)
- REINFORCE entry → REINFORCE configs: selects (evidence: `README.md`)
- PPO runner → PPO environment: initializes (evidence: `PPO/SchedulingRunner.py`)
- PPO runner → PPO policy: creates (evidence: `PPO/SchedulingRunner.py`)
- PPO runner → PPO trainer: creates (evidence: `PPO/SchedulingRunner.py`)
- PPO runner → PPO evaluator: uses (evidence: `PPO/SchedulingRunner.py`)
- PPO runner → PPO utilities: calls (evidence: `PPO/SchedulingRunner.py`)
- PPO trainer → PPO policy: evaluates policy (evidence: `PPO/PPOTrainer.py`)
- PPO trainer → PPO utilities: uses (evidence: `PPO/PPOTrainer.py`)
- PPO evaluator → PPO policy: evaluates policy (evidence: `PPO/SchedulingEvaluator.py`)
- PPO evaluator → PPO utilities: uses (evidence: `PPO/SchedulingEvaluator.py`)
- PPO environment → PPO generators: constructs (evidence: `PPO/SchedulingEnvironment.py`)
- PPO environment → PPO SD1 generator: constructs (evidence: `PPO/SchedulingEnvironment.py`)
- PPO CP-SAT → PPO generators: uses (evidence: `PPO/cp_sat.py`)
- PPO CP-SAT → PPO SD1 generator: uses (evidence: `PPO/cp_sat.py`)
- REINFORCE runner → REINFORCE environment: initializes (evidence: `REINFORCE/SchedulingRunner.py`)
- REINFORCE runner → REINFORCE policy: creates (evidence: `REINFORCE/SchedulingRunner.py`)
- REINFORCE runner → REINFORCE trainer: creates (evidence: `REINFORCE/SchedulingRunner.py`)
- REINFORCE runner → REINFORCE evaluator: uses (evidence: `REINFORCE/SchedulingRunner.py`)
- REINFORCE runner → REINFORCE utilities: calls (evidence: `REINFORCE/SchedulingRunner.py`)
- REINFORCE trainer → REINFORCE policy: evaluates policy (evidence: `REINFORCE/REINFORCETrainer.py`)
- REINFORCE evaluator → REINFORCE policy: evaluates policy (evidence: `REINFORCE/SchedulingEvaluator.py`)
- REINFORCE environment → REINFORCE generators: constructs (evidence: `REINFORCE/SchedulingEnvironment.py`)
- REINFORCE environment → REINFORCE SD1 generator: constructs (evidence: `REINFORCE/SchedulingEnvironment.py`)
- REINFORCE CP-SAT → REINFORCE generators: uses (evidence: `REINFORCE/cp_sat.py`)
- REINFORCE CP-SAT → REINFORCE SD1 generator: uses (evidence: `REINFORCE/cp_sat.py`)
- PPO configs → Problem datasets: configures loading (evidence: `README.md`)
- REINFORCE configs → Problem datasets: configures loading (evidence: `README.md`)
- PPO runner → Model checkpoints: loads or saves (evidence: `README.md`)
- REINFORCE runner → Model checkpoints: loads or saves (evidence: `README.md`)
- PPO CP-SAT → PPO evaluator: baseline comparison
- REINFORCE CP-SAT → REINFORCE evaluator: baseline comparison
