X-Git-Url: https://mattmccutchen.net/match/match.git/blobdiff_plain/eb6c3c9f810799e3bfe8cd302dd9d00f97b4baf7..35ce78e3b164a71da6177f0577b598a12198d237:/program/Evaluation.hs diff --git a/program/Evaluation.hs b/program/Evaluation.hs index 2b1fdaf..032a1a9 100644 --- a/program/Evaluation.hs +++ b/program/Evaluation.hs @@ -1,5 +1,6 @@ module Evaluation where import PMInstance +import PMConfig import ProposalMatcher import Data.Array.IArray @@ -17,15 +18,11 @@ evaluateMatching cfg inst@(PMInstance numRvrs numProps rloadA prefA) matching = -- Sort this proposal's reviews, best first. let jPrefsInc = sort $ map (\i -> prefA ! (i,j)) rl in -- Charge each review's assignmentCost. - sum $ zipWith (\wt prf -> (numAsWt wt) * assignmentCost cfg prf) - -- The assignment costs are weighted by - -- reviewsEachProposal, ..., 1 from best to worst. - -- (It's most important for the best to be good.) - (take (reviewsEachProposal cfg) $ - iterate (subtract 1) (reviewsEachProposal cfg)) + sum $ zipWith (\wt prf -> wt * assignmentCost cfg prf) + (reviewEvalWeights cfg) -- A missing review counts as a preference of 50 (really bad). (jPrefsInc ++ repeat 50) - ) + ) reviewersByProposal doEvaluateMatching :: PMConfig -> PMInstance -> MatchingEvaluation