SJF and SRTF scheduling programs with Gantt charts and captured output
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5v46dt7TVsHZxtoYC
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# Rebuilds both programs and regenerates every file in output/.
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
mkdir -p output build
|
||||
CXX=${CXX:-g++}
|
||||
$CXX -std=c++17 -Wall -Wextra -O2 -o build/sjf sjf_nonpreemptive.cpp
|
||||
$CXX -std=c++17 -Wall -Wextra -O2 -o build/srtf srtf_preemptive.cpp
|
||||
$CXX -std=c++17 -o build/old legacy/old_sjf_sort_by_burst.cpp
|
||||
|
||||
build/sjf < input/all-at-zero.txt > output/01-sjf-all-at-zero.txt
|
||||
build/sjf < input/staggered.txt > output/02-sjf-staggered.txt
|
||||
build/srtf < input/staggered.txt > output/03-srtf-staggered.txt
|
||||
build/sjf < input/preemption.txt > output/04-sjf-preemption-case.txt
|
||||
build/srtf < input/preemption.txt > output/05-srtf-preemption-case.txt
|
||||
build/sjf < input/idle-gap.txt > output/06-sjf-idle-gap.txt
|
||||
build/old < input/legacy-4proc.txt | sed -n '/Result/,$p' > output/07-legacy-wrong-result.txt
|
||||
{ echo 4; cat input/legacy-4proc.txt; } | build/sjf > output/08-sjf-same-input-corrected.txt
|
||||
echo "done: $(ls output | wc -l) files in output/"
|
||||
Reference in New Issue
Block a user