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:
Lucas Rayan committed 2026-03-19 16:45:05 -03:00
1 parent 083fc0027e
commit 51a8a6fa40
38 files changed
+2530 -45

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@ const ProcessForm = ({ editingProcess, onClose }: ProcessFormProps) => {
if (bursts.at(-1)?.type !== 'cpu') errs.push('O último burst deve ser CPU');
bursts.forEach((b, i) => {
if (b.duration < 1) errs.push(`Burst ${i + 1}: duração deve ser ≥ 1`);
if (i > 0 && bursts[i - 1].type === b.type) errs.push(`Bursts ${i} e ${i + 1} não podem ser do mesmo tipo (alternar CPU/IO)`);
if (i > 0 && bursts[i - 1]?.type === b.type) errs.push(`Bursts ${i} e ${i + 1} não podem ser do mesmo tipo (alternar CPU/IO)`);
});
setErrors(errs);
return errs.length === 0;