X-Git-Url: https://mattmccutchen.net/match/match.git/blobdiff_plain/967c39efa10c8a2d74812741cd7a2a96602a6210..066d7f5355c79a94b6d3a6fb2008e0a506b289c7:/program/Instance.hs diff --git a/program/Instance.hs b/program/Instance.hs index 95e00ee..384666f 100644 --- a/program/Instance.hs +++ b/program/Instance.hs @@ -1,11 +1,10 @@ -module Instance where +module Instance (module Instance, Wt) where +import ProposalMatcherConfig (Wt) import Data.Array.IArray import Data.Array.Unboxed import ArrayStuff import Formatter -type Wt = Double -- must implement RealFrac - data Instance = Instance Int -- numReviewers Int -- numProposals @@ -15,7 +14,9 @@ data Instance = Instance instance Show Instance where show (Instance numRvrs numProps loadA prefA) = - "Instance: " ++ show numRvrs ++ " reviewers, " ++ show numProps ++ " proposals\n" - ++ "Reviewer relative load: " ++ show loadA ++ "\n" - ++ "Preferences:\n" - ++ formatTable (array2DtoListOfLists (amap2 show prefA :: Array (Int, Int) String)) + 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 + )