-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_data_simple_area_1.sh
executable file
·81 lines (75 loc) · 2.13 KB
/
build_data_simple_area_1.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
75
76
77
78
79
80
#!/bin/bash
subset="no"
outdir="data/IEEE39/converted_from_PowerFactory/all_stoch_loads/var_H_area_1_comp_grid/coarse"
confdir="area_1_config_grid_coarse/H_comp11_0.1"
ncores=36
for H in 1.0 2.0 3.0 4.0 6.0 ; do
confdir="area_1_config_grid_coarse/H_comp11_${H}"
i=0
for config in ${confdir}/training*.json ; do
logfile=`basename ${config%.json}.log`
if [ "$subset" = "yes" ] ; then
tmp=`basename $config`
num="${tmp:9:3}"
if [ "$num" = "001" ] || [ "$num" = "002" ] || [ "$num" = "012" ] || [ "$num" = "013" ] \
|| [ "$num" = "109" ] || [ "$num" = "110" ] || [ "$num" = "120" ] || [ "$num" = "121" ] ; then
python3 build_data.py -s training_set -o $outdir $config > $logfile &
sleep 10
fi
else
python3 build_data.py -s training_set -o $outdir $config > $logfile &
sleep 10
fi
let i=i+1
if [ $i -eq $ncores ] ; then
i=0
wait
fi
done
wait
done
exit 0
i=0
for config in ${confdir}/test*.json ; do
logfile=`basename ${config%.json}.log`
if [ "$subset" = "yes" ] ; then
tmp=`basename $config`
num="${tmp:5:3}"
if [ "$num" = "001" ] || [ "$num" = "002" ] || [ "$num" = "012" ] || [ "$num" = "013" ] \
|| [ "$num" = "109" ] || [ "$num" = "110" ] || [ "$num" = "120" ] || [ "$num" = "121" ] ; then
python3 build_data.py -s test_set -o $outdir $config > $logfile &
sleep 10
fi
else
python3 build_data.py -s test_set -o $outdir $config > $logfile &
sleep 10
fi
let i=i+1
if [ $i -eq $ncores ] ; then
i=0
wait
fi
done
wait
i=0
for config in ${confdir}/validation*.json ; do
logfile=`basename ${config%.json}.log`
if [ "$subset" = "yes" ] ; then
tmp=`basename $config`
num="${tmp:11:3}"
if [ "$num" = "001" ] || [ "$num" = "002" ] || [ "$num" = "012" ] || [ "$num" = "013" ] \
|| [ "$num" = "109" ] || [ "$num" = "110" ] || [ "$num" = "120" ] || [ "$num" = "121" ] ; then
python3 build_data.py -s validation_set -o $outdir $config > $logfile &
sleep 10
fi
else
python3 build_data.py -s validation_set -o $outdir $config > $logfile &
sleep 10
fi
let i=i+1
if [ $i -eq $ncores ] ; then
i=0
wait
fi
done
wait