add: project 2
This commit is contained in:
parent
2b3c28d249
commit
4e8e564b44
25 changed files with 921 additions and 3 deletions
5
project2/test/input.txt
Normal file
5
project2/test/input.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
compare
|
||||
10
|
||||
0,10,73,78,78,80,90,137,211,237
|
||||
853,1,1470,654,108,6,1074,508,1,10
|
||||
7,6,15,12,8,1,14,1,4,6
|
||||
34
project2/test/random
Executable file
34
project2/test/random
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo "Building executable..."
|
||||
|
||||
cd "${FLAKE:-$(dirname $0)}"
|
||||
if command -v nix; then
|
||||
cpu_schedulers="$(nix build --no-link --print-out-paths .#cpu-schedulers)/bin/cpu-schedulers"
|
||||
else
|
||||
make
|
||||
cpu_schedulers="build/cpu-schedulers"
|
||||
fi
|
||||
|
||||
num_processes=10
|
||||
|
||||
printf "compare\n$num_processes\n" >input.txt
|
||||
|
||||
proc_arrival=0
|
||||
for i in $(seq 2 "$num_processes"); do
|
||||
echo -n "$proc_arrival," >>input.txt
|
||||
proc_arrival=$(($RANDOM % 100 + $proc_arrival))
|
||||
done
|
||||
echo "$proc_arrival" >>input.txt
|
||||
|
||||
for i in $(seq 2 "$num_processes"); do
|
||||
echo -n $((($RANDOM % 1250) ** 4 / 1000000000 + 1))"," >>input.txt
|
||||
done
|
||||
echo $((($RANDOM % 1250) ** 4 / 1000000000 + 1)) >>input.txt
|
||||
|
||||
for i in $(seq 2 "$num_processes"); do
|
||||
echo -n $(($RANDOM % 20))"," >>input.txt
|
||||
done
|
||||
echo $(($RANDOM % 20)) >>input.txt
|
||||
|
||||
"$cpu_schedulers" -m <input.txt
|
||||
Loading…
Add table
Add a link
Reference in a new issue