Skip to content

Commit d5d05e4

Browse files
committed
Designed and executed parameter-sweep experiment
1 parent d524078 commit d5d05e4

File tree

3 files changed

+591
-0
lines changed

3 files changed

+591
-0
lines changed

analysis/markov/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
/.lake
2+
.ipynb_checkpoints/
3+
experiments/*.csv.gz
4+
experiments/*.png
5+
experiments/*.svg

analysis/markov/experiments.ipynb

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
3+
cd "$(dirname "${BASH_SOURCE[0]}")"
4+
5+
EXE="../.lake/build/bin/linleios"
6+
7+
8+
function setDefaults {
9+
Label="NA"
10+
Lhdr=1
11+
Lvote=4
12+
Ldiff=7
13+
Committee=600
14+
Quorum=0.75
15+
Validates=1
16+
Late=0
17+
Adversary=0
18+
}
19+
20+
function runModel {
21+
"$EXE" --l-header $Lhdr \
22+
--l-vote $Lvote \
23+
--l-diff $Ldiff \
24+
--committee-size $Committee \
25+
--quorum-fraction $Quorum \
26+
--p-rb-header-arrives 1 \
27+
--p-eb-validates $Validates \
28+
--p-late-diffusion $Late \
29+
--adversary-fraction $Adversary \
30+
2> /dev/null \
31+
| yaml2json \
32+
| jq -r '"'"$Label,$Lhdr,$Lvote,$Ldiff,$Committee,$Quorum,$Validates,$Late,$Adversary,"'" + (."EB efficiency" | tostring)'
33+
}
34+
35+
36+
(
37+
38+
echo $'Label,L_hdr,L_vote,L_diff,Committee size,Quorum fraction,Probability of EB validation,Probability of late diffusion,Adversary fraction,EB efficiency'
39+
40+
setDefaults
41+
Label="Ideal conditions with adversary"
42+
for Adversary in $(seq 0.00 0.01 0.35)
43+
do
44+
runModel
45+
done
46+
47+
setDefaults
48+
Label="Non-ideal network without adversary"
49+
for Validates in $(seq 0.60 0.02 1.00)
50+
do
51+
for Late in $(seq 0.00 0.02 1.00)
52+
do
53+
runModel
54+
done
55+
done
56+
57+
setDefaults
58+
Label="Committee and quorum without adversary"
59+
for Committee in $(seq 500 50 1000)
60+
do
61+
for Quorum in $(seq 0.50 0.02 1.00)
62+
do
63+
runModel
64+
done
65+
done
66+
67+
setDefaults
68+
Label="Protocol parameters without adversary"
69+
for Lhdr in 1 2
70+
do
71+
for Lvote in 3 4 5
72+
do
73+
for Ldiff in 4 5 6 7 8
74+
do
75+
runModel
76+
done
77+
done
78+
done
79+
80+
) | gzip -9c > parameter-sweep.csv.gz

0 commit comments

Comments
 (0)