-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate-cfcnfp.sh
More file actions
65 lines (51 loc) · 2.68 KB
/
generate-cfcnfp.sh
File metadata and controls
65 lines (51 loc) · 2.68 KB
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
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 N_CONSTRAINTS HAVE_ACTIVATION_COSTS"
exit 1
fi
# Generate a Constrained Fixed Charge Network Flow Problem set
# number of node
TOP_N=30
# number of arcs
TOP_M=100
# maximum capacity
MAX_CAP=10000
# maximum cost
MAX_COST=100
# to make activation cost competitive with linear cost we need
# <MAX_CAP><MAX_COST> ~ <MAX_CHARGE>
# maximum fixed charge
if [ "$2" == "Y" ]; then
MAX_CHARGE=100000
else
MAX_CHARGE=0
fi
# number of constraints
# not much sense in this, because we already want to optimize this quantity and
# we have let the constrait for this quantity to be very loose 0.1
N_CONSTRAINTS=$1
COPIES=1000
repeat(){
for i in `seq 2 ${N_CONSTRAINTS}`;do
echo -n "$1 ";
done
}
for i in `seq ${COPIES}`;
do
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.01`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.25`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.5`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.6`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.7`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.8`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.85`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.90`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.95`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.96`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.97`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.98`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.985`
python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.990`
done
echo "0000000000000000"
echo "0 0 0"