aboutsummaryrefslogtreecommitdiff
path: root/src/SenateTypes.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-01-06 18:54:42 +1100
committerJed Barber <jjbarber@y7mail.com>2017-01-06 18:54:42 +1100
commit9c88780375c5fd42f305746156484257c02245c7 (patch)
tree6eaf9ea4451357812b56229951dffa68e04c975b /src/SenateTypes.hs
parent93a9b586e82b5d113d9140ceac95acabc7d51917 (diff)
Code reworked, now 16x faster, but uses 18.5x more memory
Diffstat (limited to 'src/SenateTypes.hs')
-rw-r--r--src/SenateTypes.hs22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/SenateTypes.hs b/src/SenateTypes.hs
index 764e733..3691034 100644
--- a/src/SenateTypes.hs
+++ b/src/SenateTypes.hs
@@ -2,16 +2,14 @@ module SenateTypes(
Ranking,
Position,
CandidateID,
- AbovePreferences,
- BelowPreferences,
- FullPreferences,
- UpperMap,
- LowerMap,
- Trace
+ AboveLineBallot,
+ BelowLineBallot,
+ Criteria
) where
+
-- fairly obvious, rankings, positions and candidateIDs are all numbers
type Ranking = Int
type Position = Int
@@ -19,24 +17,18 @@ type CandidateID = String
-type AbovePreferences = [(Position,Ranking)]
-type BelowPreferences = [(Position,Ranking)]
-type FullPreferences = (AbovePreferences,BelowPreferences)
-
-
-
-- positions in the uppermap list correspond to the boxes above the line,
-- and the lists of candidateIDs are the boxes below the line
-type UpperMap = [[Position]]
+type AboveLineBallot = [[Position]]
-- a list of candidates in the order of how they were placed below the line
-type LowerMap = [CandidateID]
+type BelowLineBallot = [CandidateID]
-- represents a criteria used for finding ballots that voted a specific
-- way, for example voted for candidate C as #1, candidate F as #2, etc
-type Trace = [(Ranking,CandidateID)]
+type Criteria = [(Ranking,CandidateID)]