Implement Priority Round Robin Scheduling Algorithm with Tests
- Added `priority_rr` algorithm to handle scheduling based on priority and round-robin principles. - Created unit tests for `select()`, `shouldPreempt()`, and `isQuantumExpired()` functions to ensure correct behavior. - Developed integration tests to validate the scheduling logic under various scenarios, including preemption and round-robin execution. - Introduced `useExport` hook for exporting process metrics to CSV format. - Added `useGanttScroll` hook to manage smooth scrolling of the Gantt chart during simulation.
This commit is contained in:
1 parent
083fc0027e
commit
51a8a6fa40
38 files changed
+2530
-45
No files matched your search
@@ -64,6 +64,8 @@ export const useSimulationStore = create<SimulationStore>()((set, get) => ({
|
||||
const { _processes, _config } = get();
|
||||
if (_processes.length === 0 || _config === null) return;
|
||||
const engine = new SimulationEngine(_processes, _config);
|
||||
set({ engine, ticks: [], status: "paused" });
|
||||
// Return to "idle" so the next Play/Step re-runs init() with the
|
||||
// current processStore config (picks up algorithm changes, etc.)
|
||||
set({ engine, ticks: [], status: "idle" });
|
||||
},
|
||||
}));
|
||||
Reference in new issue
Block a user