-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpart4-evaluate-cut-selector.sh
74 lines (50 loc) · 1.25 KB
/
part4-evaluate-cut-selector.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/bash
CUTSEL=$1
SEED=0
NOSOL=0 # 1: evaluate without providing a solution
#####
target_dict="targets.json"
if jq -e --arg value "$CUTSEL" '.all_targets + ["hybrid", "boundimp"] | index($value)' "$target_dict" >/dev/null; then
echo "'$CUTSEL' is a valid target."
else
echo "'$CUTSEL' is NOT a valid target."
exit 1
fi
INSTDIR=$PWD/instances
SOLDIR=$PWD/solutions
mapfile -t ev_inst_array < $PWD/problem-lists/evaluation.txt
N=${#ev_inst_array[@]}
BEGIN=0
END=9
# to solve all evaluation problems:
#END=$((N - 1))
NTASKS=$((END - BEGIN + 1))
SEED_LIST=($(<$PWD/evaluation-seed-list.csv))
SEED_LIST=${SEED_LIST[SEED]}
IFS=$','; split=($SEED_LIST); unset IFS;
SEED=${split[0]}
S1=${split[1]}
S2=${split[2]}
S3=${split[3]}
if [[ "$CUTSEL" == "hybrid" || "$CUTSEL" == "boundimp" ]]; then
cd scip-runs/build
make
else
cd collect-data-deploy/deploy/build
make
fi
i=0
for (( run="$BEGIN"; run<="$END"; run++ ));
do
i=$((i+1))
echo "Solving problem $i / $NTASKS"
echo "Problem: ${ev_inst_array[$run]}"
PRB=$INSTDIR/${ev_inst_array[$run]}
if [[ "$NOSOL" -eq 1 ]]; then
SOLFILENAME="-"
else
SOLFILENAME=$SOLDIR/${ev_inst_array[$run]}.csv
fi
./data $SEED $PRB $S1 $S2 $S3 evaluation $CUTSEL $SOLFILENAME
echo 'done'
done