File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -67,3 +67,12 @@ def ebDistribution : Probabilities → HashMap Nat Probability :=
6767 $ singleton ⟨ state.ebCount , p ⟩
6868 )
6969 ∅
70+
71+ def ebEfficiency (states : Probabilities) : Float :=
72+ let rbCount := states.keys.head!.rbCount
73+ let ebCount :=
74+ HashMap.fold
75+ (fun acc state p =>acc + state.ebCount.toFloat * p)
76+ 0
77+ states
78+ ebCount / (rbCount.toFloat - 1 )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Linleios
44
55def env : Environment := makeEnvironment 0 .05 0 .95 0 .90 600 0 .75 1 4 7
66
7- def sn := simulate env default 1e-6 10
7+ def sn := simulate env default 1e-6 25
88
99def main : IO Unit :=
1010 do
@@ -14,4 +14,6 @@ def main : IO Unit :=
1414 IO.println ""
1515 print $ ebDistribution sn
1616 IO.println ""
17+ print $ ebEfficiency sn
18+ IO.println ""
1719 print $ 1 - totalProbability sn
You can’t perform that action at this time.
0 commit comments