Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrVoteAlreadyOngoing = errors.New("a vote is already ongoing for the given ID") ErrNoOpinionGiversAvailable = errors.New("can't perform round as no opinion givers are available") )
Functions ¶
Types ¶
type FPC ¶
type FPC struct {
// contains filtered or unexported fields
}
FPC is a DRNGRoundBasedVoter which uses the Opinion of other entities in order to finalize an Opinion.
func New ¶
func New(opinionGiverFunc vote.OpinionGiverFunc, paras ...*Parameters) *FPC
New creates a new FPC instance.
func (*FPC) IntermediateOpinion ¶
type Parameters ¶
type Parameters struct {
// The lower bound liked percentage threshold at the first round. Also called 'a'.
FirstRoundLowerBoundThreshold float64
// The upper bound liked percentage threshold at the first round. Also called 'b'.
FirstRoundUpperBoundThreshold float64
// 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'.
FinalizationThreshold int
// The amount of rounds for which to ignore any finalization checks for. Also called 'm'.
CoolingOffPeriod int
// The max amount of rounds to execute per vote context before aborting them.
MaxRoundsPerVoteContext int
// The max amount of time a query is allowed to take.
QueryTimeout time.Duration
}
Parameters define the parameters of an FPC instance.
func DefaultParameters ¶
func DefaultParameters() *Parameters
DefaultParameters returns the default parameters used in FPC.
Click to show internal directories.
Click to hide internal directories.