Make the evaluator's review weights configurable.
authorMatt McCutchen <matt@mattmccutchen.net>
Sat, 2 Aug 2008 20:20:44 +0000 (16:20 -0400)
committerMatt McCutchen <matt@mattmccutchen.net>
Sat, 2 Aug 2008 20:20:44 +0000 (16:20 -0400)
program/Evaluation.hs
program/PMConfig.hs
program/PMDefaults.hs

index c93e799..032a1a9 100644 (file)
@@ -18,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.
                -- 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)
                        -- A missing review counts as a preference of 50 (really bad).
                        (jPrefsInc ++ repeat 50)
-                       )
+               )
                reviewersByProposal
 
 doEvaluateMatching :: PMConfig -> PMInstance -> MatchingEvaluation
                reviewersByProposal
 
 doEvaluateMatching :: PMConfig -> PMInstance -> MatchingEvaluation
index ecbe1cb..d88f3d4 100644 (file)
@@ -25,5 +25,6 @@ data PMConfig = PMConfig {
        knowledgeableBonus :: Wt,
        expertBonus :: Wt,
        numTopics :: Int,
        knowledgeableBonus :: Wt,
        expertBonus :: Wt,
        numTopics :: Int,
-       topicZipfExponent :: Wt
+       topicZipfExponent :: Wt,
+       reviewEvalWeights :: [Wt]
 }
 }
index a68d182..2f4a687 100644 (file)
@@ -67,6 +67,14 @@ expertBonus = 1000,
 numTopics = 20,
 
 -- Exponent of the Zipf distribution used to choose topics for each proposal.
 numTopics = 20,
 
 -- Exponent of the Zipf distribution used to choose topics for each proposal.
-topicZipfExponent = -0.5
+topicZipfExponent = -0.5,
+
+-- === Parameters for the matching evaluator ===
+
+-- The weights given to the best, ..., worst review of a proposal in evaluating
+-- its "unhappiness".  Default is [reviewsEachProposal, ..., 1] since it's most
+-- important for the best review to be good.
+reviewEvalWeights = let rep = reviewsEachProposal pmDefaults in
+       map numAsWt [rep, rep-1 .. 1]
 
 }
 
 }