From 2a1ddd65a75e19bc90db7a119fce36468eaf0eac Mon Sep 17 00:00:00 2001 From: Luca Moser <moser.luca@gmail.com> Date: Wed, 15 Apr 2020 10:33:50 +0200 Subject: [PATCH] remove beta and introduce subs. upper bound parameter --- packages/vote/fpc/fpc.go | 2 +- packages/vote/fpc/parameters.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/vote/fpc/fpc.go b/packages/vote/fpc/fpc.go index a8c9ce2c..47ae4a2e 100644 --- a/packages/vote/fpc/fpc.go +++ b/packages/vote/fpc/fpc.go @@ -134,7 +134,7 @@ func (f *FPC) formOpinions(rand float64) { } lowerThreshold := f.paras.SubsequentRoundsLowerBoundThreshold - upperThreshold := 1 - f.paras.SubsequentRoundsLowerBoundThreshold + upperThreshold := f.paras.SubsequentRoundsUpperBoundThreshold if voteCtx.HadFirstRound() { lowerThreshold = f.paras.FirstRoundLowerBoundThreshold diff --git a/packages/vote/fpc/parameters.go b/packages/vote/fpc/parameters.go index 997ca759..2642ab55 100644 --- a/packages/vote/fpc/parameters.go +++ b/packages/vote/fpc/parameters.go @@ -8,8 +8,10 @@ type Parameters struct { FirstRoundLowerBoundThreshold float64 // The upper bound liked percentage threshold at the first round. Also called 'b'. FirstRoundUpperBoundThreshold float64 - // The liked percentage threshold used after the first round. Also called 'beta'. + // The lower bound liked percentage threshold used after the first round. SubsequentRoundsLowerBoundThreshold float64 + // The upper bound liked percentage threshold used after the first round. + SubsequentRoundsUpperBoundThreshold float64 // The amount of opinions to query on each round for a given vote context. Also called 'k'. QuerySampleSize int // The amount of rounds a vote context's opinion needs to stay the same to be considered final. Also called 'l'. @@ -26,8 +28,9 @@ type Parameters struct { func DefaultParameters() *Parameters { return &Parameters{ FirstRoundLowerBoundThreshold: 0.75, - FirstRoundUpperBoundThreshold: 0.85, - SubsequentRoundsLowerBoundThreshold: 0.33, + FirstRoundUpperBoundThreshold: 0.75, + SubsequentRoundsLowerBoundThreshold: 0.50, + SubsequentRoundsUpperBoundThreshold: 0.67, QuerySampleSize: 10, FinalizationThreshold: 2, CoolingOffPeriod: 2, -- GitLab