summaryrefslogtreecommitdiff
path: root/src/Election.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Election.hs')
-rw-r--r--src/Election.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Election.hs b/src/Election.hs
index 5ffba0d..ea23a05 100644
--- a/src/Election.hs
+++ b/src/Election.hs
@@ -16,10 +16,10 @@ import Data.List ( (\\) )
import qualified Data.List as List
import qualified Data.Maybe as Maybe
import qualified Data.Either.Unwrap as Either
+import Data.Ratio ( (%) )
import qualified Counter as Sen
import qualified Candidate as Typ
import qualified CSV as CSV
-import Miscellaneous ( (.:) )
import qualified Miscellaneous as Misc
@@ -52,7 +52,7 @@ data Entry = Entry
data Trace = Trace
{ getCriteria :: Sen.Criteria
- , getTransferVal :: Float }
+ , getTransferVal :: Rational }
deriving (Eq)
data Status = Running | Elected | Eliminated
@@ -61,7 +61,7 @@ data Status = Running | Elected | Eliminated
data Transfer = Transfer
{ getWhoFrom :: Typ.CandidateID
, getVoteAmount :: Int
- , getNewValue :: Float
+ , getNewValue :: Rational
, getWhatToDist :: [Trace] }
@@ -210,7 +210,7 @@ doElectCandidate e = do
newTransfer = Transfer
{ getWhoFrom = getID electedEntry
, getVoteAmount = getTotalVotes electedEntry - getQuota e
- , getNewValue = (fromIntegral (getTotalVotes electedEntry - getQuota e)) /
+ , getNewValue = (fromIntegral (getTotalVotes electedEntry - getQuota e)) %
(fromIntegral (getTotalVotes electedEntry))
, getWhatToDist = getCritTrace electedEntry }