X-Git-Url: https://mattmccutchen.net/match/match.git/blobdiff_plain/8723ed6adebc35a25ca240acdb587444c85fb44f..e5c5cbd9d48ecf8de5e7b0c20d7164b4b7bf340b:/program/PMInstanceGenerator.hs diff --git a/program/PMInstanceGenerator.hs b/program/PMInstanceGenerator.hs index 0f78b02..9cafacd 100644 --- a/program/PMInstanceGenerator.hs +++ b/program/PMInstanceGenerator.hs @@ -35,7 +35,7 @@ data ProposalInfo = ProposalInfo { } randomTopic cfg = withWeight $ - map (\i -> (numAsWt (i+1) ** topicZipfExponent cfg, return i)) + map (\i -> (widenInteger (i+1) ** topicZipfExponent cfg, return i)) [0 .. numTopics cfg - 1] randomProposalInfo cfg = do @@ -68,5 +68,19 @@ randomInstance cfg numRvrs numProps = do PTopic1 jt1 -> expertnessToPref (iTE ! jt1) PTopic2 jt1 jt2 -> (expertnessToPref (iTE ! jt1) + expertnessToPref (iTE ! jt2)) / 2 - in if isConflict then 40 else topicPref * jD - 4) - return $ PMInstance numRvrs numProps loadA prefA + -- Use a formula designed for the old pref scale with the new. + in if isConflict then -100 else prefOldToNew (topicPref * jD - 4)) + let expA = funcArray ((0, 0), (numRvrs-1, numProps-1)) (\(i,j) -> + let + ReviewerInfo iTE iC = reviewerInfos ! i + ProposalInfo jT jD = proposalInfos ! j + isConflict = elem j iC + topicExp = case jT of + PTopic1 jt1 -> 1 + (iTE ! jt1) + PTopic2 jt1 jt2 -> 1 + ((iTE ! jt1) + + (iTE ! jt2)) / 2 + in topicExp) + -- defaults + let fixA = constArray ((0,0), (numRvrs-1,numProps-1)) False + let pnrA = constArray (0, numProps-1) (reviewsEachProposal cfg) + return $ PMInstance numRvrs numProps loadA prefA expA fixA pnrA