-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrusted.sh
executable file
·77 lines (73 loc) · 2.34 KB
/
trusted.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
#!/bin/bash
# $1 : expe number
# $2 : peers
# $3 : viewsize
# $4 : byzpercent
# $5 : trustpercent
# $6 : sample memory
# $7 : number of rounds
# $8 : debiasing strategy
# $9 : merge strategy
# $10 : gamma = beta = (1 - beta)/2
# $11 : share knowledge
# $12 : replacement count
# $13 : replacement frequency
expe="${1:-0}"
shift
echo "Experiment ($expe) with params $@"
N="${1:-10000}"
v="${2:-160}"
f="${3:-0.10}"
force="${4:-10}"
sm="${5:-100}"
roundMax="${6:-200}"
strat="${7:-1}"
k="${8:-0}" #number_of_partitions
r="${9:-1}" #number_of_hash_functions
t="${10:-0.1}"
#mergestrat="${9:-0}"
#gamma="${10:-0.2}"
if [ $strat -eq 0 ]; then
stratLitt="aupe-merge"
elif [ $strat -eq 1 ]; then
stratLitt="aupe-global"
elif [ $strat -eq 2 ]; then
stratLitt="aupe"
elif [ $strat -eq 3 ]; then
stratLitt="basalt-simple"
elif [ $strat -eq 4 ]; then
stratLitt="brahms"
fi
rho=$(echo "scale=0; $k / $r / 1" | bc)
mkdir analysis
mkdir "./analysis/rho"$rho
mkdir "./analysis/rho"$rho"/"$N
mkdir "./analysis/rho"$rho"/"$N"/"$stratLitt
folder="./analysis/rho"$rho"/"$N"/"$stratLitt"/expe"$expe
mkdir $folder
F=$(echo "scale=0; 100.0 * $f / 1" | bc)
echo $folder"/text"$F
byz=$(echo "scale=0; $N * $f / 1" | bc)
if [ $strat -eq 0 ]; then
T=$(echo "scale=0; 100.0 * $t / 1" | bc)
echo $folder"/text"$F"-"$T
trust=$(echo "scale=0; $N * $t / 1" | bc)
sup=30 # sup Merges
#cargo run -- -T $roundMax -n $N aupe -O -G samples -f $force -t $byz -x $trust \
./aupeM -T $roundMax -n $N aupe -O -G samples -f $force -t $byz -x $trust \
-v $v -u $v -k $k -r $r -m $sm -n $N -p $sup > $folder"/text"$F"-"$T
elif [ $strat -eq 1 ]; then
cargo run -- -T $roundMax -n $N aupe -L -G samples -f $force -t $byz \
-v $v -u $v -k $k -r $r -m $sm -n $N > $folder"/text"$F
elif [ $strat -eq 2 ]; then
#cargo run -- -T $roundMax -n $N aupe -G samples -f $force -t $byz \
./aupewoponderation -T $roundMax -n $N aupe -G samples -f $force -t $byz \
-v $v -u $v -k $k -r $r -m $sm -n $N > $folder"/text"$F
elif [ $strat -eq 3 ]; then
cargo run -- -T $roundMax -n $N basalt-simple -G -f $force -t $byz \
-v $v -i $v -k $k -r $r > $folder"/text"$F
elif [ $strat -eq 4 ]; then
cargo run -- -T $roundMax -n $N brahms -G samples -f $force -t $byz \
-v $v -u $v -k $k -r $r > $folder"/text"$F
fi
echo "Done------------------------"