X-Git-Url: https://mattmccutchen.net/match/match.git/blobdiff_plain/9ecd6424ffbf1305e7344b99517c4fbb04b26df2..2e7d542623d17554667ca0199dd988caf3c442ae:/program/ProposalMatchConfig.hs diff --git a/program/ProposalMatchConfig.hs b/program/ProposalMatchConfig.hs index 39055c1..42b47f6 100644 --- a/program/ProposalMatchConfig.hs +++ b/program/ProposalMatchConfig.hs @@ -1,29 +1,40 @@ module ProposalMatchConfig where +type Pref = Int +type Wt = Double -- must implement RealFrac + +numAsWt x = fromInteger (toInteger x) :: Wt + +reviewsEachProposal = 3 :: Int + prefIsExpert p = p <= 10 +prefIsKnowledgeable p = p <= 20 + +prefIsBoring p = p > 15 +prefIsVeryBoring p = p > 25 + prefIsConflict p = p >= 40 -{- -Each proposal should have 'wantExpertReviews' expert reviews plus -'wantGeneralReviews' general reviews (can be by experts). If we -fall short on expert reviews, we give 'wantReviewsSubstForExpert' -additional general reviews for each expert review we fell short. -Values 2, 1, 2 give the ">= 3 of which >= 1 is expert, failing that >= 4" -criterion that Samir indicated. --} -wantGeneralReviews = 2 -wantExpertReviews = 1 -wantReviewsSubstForExpert = 2 - --- A hard limit that we hope will never be hit. -maxReviewerLoad = 10 +-- For now this is absolute. Later it might be proportional to a reviewer's +-- target load. +loadTolerance = 1 :: Int +-- Cost to overload by one review. +-- tx = 0 at target load, 1 at end of tolerance. +marginalLoadCost tx = 1000 + tx*1000 :: Wt + +-- Cost to review a boring (or very boring) proposal. +-- lx = 0 at no load, 1 at target load. +marginalBoringCost lx = 1000 + lx*1000 :: Wt +-- Additional cost to review a very boring proposal. +marginalVeryBoringCost lx = 1000 + lx*1000 :: Wt + +-- Cost to make a review. -- I'm using quadratic cost functions as a first attempt. -prefToCost p = p ^ 2 -{- -I chose the number 225 to make the preference difference between 20 and 25 -approximately equivalent to one unit of load imbalance (e.g., the difference -between (k, k) and (k+1, k-1)); that seemed reasonable to me. -Adjust the number as necessary. --} -marginalLoadCost nr = 225 * fromInteger nr +assignmentCost pref = (numAsWt 10 + pref) ^ 2 :: Wt + +-- Bonus for a first knowledgeable or expert review. +knowledgeableBonus = 1000 :: Wt + +-- Bonus for an additional expert review. +expertBonus = 1000 :: Wt