-
Notifications
You must be signed in to change notification settings - Fork 23
/
run.sh
executable file
·33 lines (28 loc) · 1012 Bytes
/
run.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
33
#!/bin/bash
# Number of threads for solving.
t=8
# Exploration level.
x=1
sol_folder="solutions_t_${t}_x_${x}"
solutions=()
# Loop over list of folder in input.
for class in "$@"
do
echo "* Solving with ${t} threads and exploration level ${x}, output written to ${class}/${sol_folder}"
mkdir ${class}/${sol_folder}
for file in `ls ${class}/*.json`
do
base_file=`basename ${file}`
sol_file=${class}/${sol_folder}/${base_file%.json}_sol.json
solutions+=($sol_file)
[ -f ${sol_file} ] || echo "Solving ${file%.json}"
[ -f ${sol_file} ] || vroom -i ${file} -o ${sol_file} -t ${t} -x ${x}
done
done
echo "* Compare all results to best known solutions."
python3 ../compare_to_BKS.py BKS.json ${solutions[@]} > ${sol_folder}.csv
echo " - output written to ${sol_folder}.csv"
echo "* Retrieve indicators by class."
indic="indicators_t_${t}_x_${x}.csv"
python3 class_indicators.py BKS.json ${solutions[@]} > ${indic}
echo " - output written to ${indic}"