Project 3 of 4
Systems programming · Algorithm implementation · Late 2025
POFP Scheduler
A Python simulator for ASAP and ALAP task preferences.
- Role
- Scheduling-model implementation
- Deliverable
- Python task models, priority assigners, queues, and scheduling traces
- Focus
- Execution preferences · event-driven simulation
Overview
This project models periodic tasks with execution cost, period, and an ASAP or ALAP preference. Priority assigners and a scheduler turn that task set into dispatch decisions and time segments.
- Python
- heapq
- Fixed-priority scheduling
- ASAP / ALAP
A task set, running.
30 time units. ASAP and ALAP preferences.
| Task | Cost | Period | Mode |
|---|---|---|---|
| T1 | 1 | 5 | ASAP |
| T2 | 3 | 10 | ASAP |
| T3 | 1 | 5 | ALAP |
| T4 | 1 | 10 | ALAP |
Inspect execution intervals
T1_1: 0 → 1
T2_1: 1 → 3
T3_1: 3 → 4
T2_1: 4 → 5
T1_2: 5 → 6
T4_1: 6 → 7
T3_2: 8 → 9
T1_3: 10 → 11
T2_2: 11 → 13
T3_3: 13 → 14
T2_2: 14 → 15
T1_4: 15 → 16
T4_2: 16 → 17
T3_4: 18 → 19
T1_5: 20 → 21
T2_3: 21 → 23
T3_5: 23 → 24
T2_3: 24 → 25
T1_6: 25 → 26
T4_3: 26 → 27
T3_6: 28 → 29Implementation source
POFP scheduler with ready and delay queues
POFP_Scheduler stores ready entries in QR and delayed jobs with their promotion times in QD. run_pofp returns schedule segments.
algorithms/algo3_with_PORMS.py
Visit the product siteScope
Work completed and source material.Scope and evidence
Scope and contribution.
This is a Python scheduling simulator. The repository contains RMS and PPA assigners, POFP variants, Gantt-chart code, and a slack-management variant. The audit confirms source structures and the pilot task set; it does not establish operating-system integration, benchmark improvements, or formal correctness.
algo1and2.py defines Task with cost, period, and theta, plus RMS and PPA priority assigners.
algo3_with_PORMS.py uses heap-based QR and QD queues and per-job promotion timers.
pilot_program.py supplies four tasks with theta=1 for ASAP and theta=0 for ALAP.
porms_with_slackmanagement.py adds a separate slack queue and slack-wrapping logic.
The portfolio execution example was generated from the inspected implementation using the four pilot tasks, RMS priorities, and the default 30-unit horizon; its intervals are preserved in lib/scheduler-preview.json.
Problem
Main technical constraint.Problem framing
Preference affects when a ready job should execute.
ASAP jobs and ALAP jobs share a processor but have different execution preferences. Priority, release, promotion, remaining cost, and preemption need explicit representation to make dispatch decisions inspectable.
Implementation
4 implementation steps.Implementation
Make queue transitions explicit.
- Step1
Represent each task's cost, period, and preference separately from each released job.
- Step2
Assign priorities using the available RMS or PPA implementation.
- Step3
Store ready jobs and delayed promotions in separate heaps.
- Step4
Advance through scheduling events and record execution segments; keep slack-management code in its own variant.
Result
A concrete simulator and task set.
The repository contains priority assignment, queue handling, promotion calculations, schedule segments, and charting code. The exhibit reproduces the four tasks in the pilot program, without inventing a performance comparison.
What I learned
Task inputs and recorded schedule segments make the scheduling decisions easier to inspect than an unexplained chart.