From 9f31a9161a03c0e2b4844ae7750f084b8924f7de Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Sun, 25 Feb 2024 18:25:58 -0300 Subject: [PATCH] save before refactor --- probppl.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/probppl.go b/probppl.go index fc362f0..200fd84 100644 --- a/probppl.go +++ b/probppl.go @@ -8,6 +8,11 @@ import ( ) type src = *rand.Rand +type IntProbability { + N int64 + p float64 +} + type pplKnownDistrib = map[int64]float64 func generatePeopleKnownDistribution(r src) map[int64]float64 { @@ -120,7 +125,7 @@ func draw148PplFromDistributionAndCheck(d pplKnownDistrib, r src, show bool) int func getUnnormalizedBayesianUpdateForDistribution(d pplKnownDistrib, r src) int64 { var sum int64 = 0 - n := 100 + n := 1000 for i := 0; i < n; i++ { /* if i%1000 == 0 { fmt.Println(i) @@ -137,6 +142,7 @@ func main() { var r = rand.New(rand.NewPCG(uint64(1), uint64(2))) sum := int64(0) + distribs := [](int64, pplKnownDistrib){} for i := 0; i < 1000; i++ { people_known_distribution := generatePeopleKnownDistribution(r) @@ -146,6 +152,7 @@ func main() { if result > 0 { fmt.Println(people_known_distribution) fmt.Println(result) + distribs.append() } sum += result // fmt.Println(result)