majurity-judgment-2.0.2.20190414: Majority Judgment voting system.
Safe HaskellNone
LanguageHaskell2010

Majurity.Judgment.Gauge

Description

which is sufficient to determine the MajorityRanking when the number of judges is large.

Synopsis

Type MajorityGauge

data MajorityGauge g Source #

The MajorityGauge is a simplification of the majorityValue from which may be deduced the majorityRanking among the propositions in many cases; in particular, when there are many judges.

However, when two propositions are tied with the same MajorityGauge, they are not necessarily tied according to their majorityValues.

Constructors

MajorityGauge 

Fields

Instances

Instances details
Eq g => Eq (MajorityGauge g) Source # 
Instance details

Defined in Majurity.Judgment.Gauge

Ord g => Ord (MajorityGauge g) Source #

The MajorityGauge-ranking, first tries to rank according to the majorityGrade mgGrade.

If both MajorityGauges have the same mgGrade, it tries to rank according to the mgSign of both MajorityGauges: a Plus is ahead of a Minus.

If both mgSign are Plus, the one having the higher mgHigher is ahead, or if both mgSign are Minus, the one having the higher mgLower is behind.

Otherwise, the MajorityGauge-ranking is a tie.

Instance details

Defined in Majurity.Judgment.Gauge

Show g => Show (MajorityGauge g) Source # 
Instance details

Defined in Majurity.Judgment.Gauge

Type Sign

data Sign Source #

Constructors

Minus 
Plus 

Instances

Instances details
Eq Sign Source # 
Instance details

Defined in Majurity.Judgment.Gauge

Methods

(==) :: Sign -> Sign -> Bool #

(/=) :: Sign -> Sign -> Bool #

Show Sign Source # 
Instance details

Defined in Majurity.Judgment.Gauge

Methods

showsPrec :: Int -> Sign -> ShowS #

show :: Sign -> String #

showList :: [Sign] -> ShowS #

mgSign :: MajorityGauge g -> Sign Source #

If mgHigher is higher than mgLower then the majorityGrade is completed by a Plus; otherwise the majorityGrade is completed by a Minus.

This indicates the side of the next majorityGrade which is different than the current one: Minus when it is lower and Plus otherwise.

majorityGauge :: Ord grade => Merit grade -> Maybe (MajorityGauge grade) Source #

majorityGauges :: Ord grade => Merit grade -> [MajorityGauge grade] Source #

Type MajorityGaugeRanking

type MajorityGaugeRanking choice grade = [(choice, [MajorityGauge grade])] Source #

majorityGaugesByChoice :: Ord grade => MeritByChoice choice grade -> HashMap choice [MajorityGauge grade] Source #

majorityGaugeRanking :: Ord grade => MeritByChoice choice grade -> MajorityGaugeRanking choice grade Source #