feat: Implement initial Process Scheduling Simulator application with core logic, algorithms, UI components, and project setup.

This commit is contained in:
Lucas Guerra committed 2026-03-19 14:12:21 -03:00
commit 083fc0027e
54 files changed
+8815

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import type { SchedulerAlgorithm } from "./index";
/**
* RR — Round Robin
* FIFO queue with a configurable quantum.
* select() returns the front of the queue (insertion-order maintained by engine).
* Preemption is driven by quantum expiry, not by a better candidate.
*/
export const rr: SchedulerAlgorithm = {
select(readyQueue) {
return readyQueue[0] ?? null;
},
// RR does not preempt based on candidate priority; quantum expiry handles it.
shouldPreempt() {
return false;
},
isQuantumExpired(runtime) {
return runtime.quantumRemaining <= 0;
},
};