hjugement-2.0.1.20190208: Majority Judgment.

Safe HaskellNone
LanguageHaskell2010

Majority.Gauge

Contents

Description

WARNING: the MajorityGauge is a simplified MajorityValue which is sufficient to determine the MajorityRanking when the number of judges is large. It is an approximation, it can perfectly lead to a wrong ranking wrt. the MajorityRanking done by using majorityValue.

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
Eq g => Eq (MajorityGauge g) Source # 
Instance details

Defined in Majority.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 Majority.Gauge

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

Defined in Majority.Gauge

Type Sign

data Sign Source #

Constructors

Minus 
Plus 
Instances
Eq Sign Source # 
Instance details

Defined in Majority.Gauge

Methods

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

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

Show Sign Source # 
Instance details

Defined in Majority.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 #