1 module Instance (module Instance, Wt) where
2 import ProposalMatcherConfig (Wt)
3 import Data.Array.IArray
4 import Data.Array.Unboxed
8 data Instance = Instance
11 (UArray Int Wt) -- ! reviewer -> relative load
12 (UArray (Int, Int) Wt) -- ! (reviewer, proposal) -> pref
15 instance Show Instance where
16 show (Instance numRvrs numProps loadA prefA) =
17 let theRvrs = [0..numRvrs-1]; theProps = [0..numProps-1] in
18 "Instance with " ++ show numRvrs ++ " reviewers and " ++ show numProps ++ " proposals:\n" ++ formatTable (
19 ( "" : map (\i -> "R#" ++ show i ) theRvrs) :
20 ( "RLoad" : map (\i -> show (loadA ! i) ) theRvrs) :
21 map (\j -> ("P#" ++ show j) : map (\i -> show (prefA ! (i, j))) theRvrs) theProps