-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.sh
executable file
·32 lines (25 loc) · 924 Bytes
/
benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
if [ $# -ne 3 ]; then
echo "Usage: ./benchmark.sh <dataDir> <timeLimit (sec)> <verbose (int)>"
exit 1
fi
echo "Experimental Campaign:"
echo "Data directory: $1"
echo "Time limit: $2 seconds"
echo "Verbose: $3"
echo `date` > results.txt
nbFiles=`ls $1 | wc -l`
nbFiles=`expr $nbFiles / 2`
echo "Number of instances: $nbFiles"
modelFile="model"
assignmentFile="assignment"
suffix=`ls $1 | head -1 | cut -d'_' -f2`
for i in `seq 1 $nbFiles`; do
echo "Solving instance $i"
echo "Solving instance $i" >> results.txt
echo "-----------------------------------------------------------------------------" >> results.txt
python3 src/run.py ./$1/$modelFile"_"$suffix"_"$i.txt ./$1/$assignmentFile"_"$suffix"_"$i.txt $2 $3 >> results.txt
echo "-----------------------------------------------------------------------------" >> results.txt
done
echo "Experimental Campaign finished!"
exit 0