X-Git-Url: https://mattmccutchen.net/match/match.git/blobdiff_plain/8c5ee850714e315aabbdcd173728e60811206b2c:/program/Instance.hs..05a6f0edaacc70ab373988ec4bafdf9963551004:/program/PMInstance.hs diff --git a/program/Instance.hs b/program/PMInstance.hs similarity index 82% rename from program/Instance.hs rename to program/PMInstance.hs index 145a8f3..d039810 100644 --- a/program/Instance.hs +++ b/program/PMInstance.hs @@ -1,4 +1,4 @@ -module Instance where +module PMInstance where import Data.Array.IArray import Data.Array.Unboxed import ArrayStuff @@ -7,18 +7,21 @@ import Formatter type Wt = Double -- Can be any RealFrac. numAsWt x = fromInteger (toInteger x) -data Instance = Instance +data PMInstance = PMInstance Int -- numReviewers Int -- numProposals (UArray Int Wt) -- ! reviewer -> relative load (UArray (Int, Int) Wt) -- ! (reviewer, proposal) -> pref deriving Eq -instance Show Instance where - show (Instance numRvrs numProps loadA prefA) = +instance Show PMInstance where + show (PMInstance numRvrs numProps loadA prefA) = let theRvrs = [0..numRvrs-1]; theProps = [0..numProps-1] in "Instance with " ++ show numRvrs ++ " reviewers and " ++ show numProps ++ " proposals:\n" ++ formatTable ( ( "" : map (\i -> "R#" ++ show i ) theRvrs) : ( "RLoad" : map (\i -> show (loadA ! i) ) theRvrs) : map (\j -> ("P#" ++ show j) : map (\i -> show (prefA ! (i, j))) theRvrs) theProps ) + +type PMatching = [(Int, Int)] + \ No newline at end of file