|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +if [ $# -ne 2 ]; then |
| 4 | + echo "Usage: $0 N_CONSTRAINTS HAVE_ACTIVATION_COSTS" |
| 5 | + exit 1 |
| 6 | +fi |
| 7 | + |
| 8 | +# Generate a Constrained Fixed Charge Network Flow Problem set |
| 9 | + |
| 10 | +# number of node |
| 11 | +TOP_N=30 |
| 12 | + |
| 13 | +# number of arcs |
| 14 | +TOP_M=100 |
| 15 | + |
| 16 | +# maximum capacity |
| 17 | +MAX_CAP=10000 |
| 18 | + |
| 19 | +# maximum cost |
| 20 | +MAX_COST=100 |
| 21 | + |
| 22 | +# to make activation cost competitive with linear cost we need |
| 23 | +# <MAX_CAP><MAX_COST> ~ <MAX_CHARGE> |
| 24 | + |
| 25 | +# maximum fixed charge |
| 26 | +if [ "$2" == "Y" ]; then |
| 27 | + MAX_CHARGE=100000 |
| 28 | +else |
| 29 | + MAX_CHARGE=0 |
| 30 | +fi |
| 31 | + |
| 32 | +# number of constraints |
| 33 | +# not much sense in this, because we already want to optimize this quantity and |
| 34 | +# we have let the constrait for this quantity to be very loose 0.1 |
| 35 | + |
| 36 | +N_CONSTRAINTS=$1 |
| 37 | + |
| 38 | +COPIES=1000 |
| 39 | + |
| 40 | +repeat(){ |
| 41 | + for i in `seq 2 ${N_CONSTRAINTS}`;do |
| 42 | + echo -n "$1 "; |
| 43 | + done |
| 44 | +} |
| 45 | + |
| 46 | +for i in `seq ${COPIES}`; |
| 47 | +do |
| 48 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.01` |
| 49 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.25` |
| 50 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.5` |
| 51 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.6` |
| 52 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.7` |
| 53 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.8` |
| 54 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.85` |
| 55 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.90` |
| 56 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.95` |
| 57 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.96` |
| 58 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.97` |
| 59 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.98` |
| 60 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.985` |
| 61 | + python ./python/fuzzy-constrained-fcnfp.py ${TOP_N} ${TOP_M} ${MAX_CAP} ${MAX_COST} ${MAX_CHARGE} ${N_CONSTRAINTS} 0.01 `repeat 0.990` |
| 62 | +done |
| 63 | + |
| 64 | +echo "0000000000000000" |
| 65 | +echo "0 0 0" |
0 commit comments