diff --git a/common/match/matching.perf.ts b/common/match/matching.perf.ts index d27ab1c8d..229f958ef 100644 --- a/common/match/matching.perf.ts +++ b/common/match/matching.perf.ts @@ -123,13 +123,13 @@ describe('Real World Matching Performance', () => { 'new', 10, { - matchCountSum: 1044, - matchCountAvg: 15.582089552238806, - matchingSubjectsSum: 1793, - matchingSubjectsAvg: 1.7174329501915708, - matchingState: 332, - pupilWaitingTimeAvg: 20.26238745497861, - studentWaitingTimeAvg: 61.03486072712683, + matchCountSum: 1045, + matchCountAvg: 15.597014925373134, + matchingSubjectsSum: 1748, + matchingSubjectsAvg: 1.6727272727272726, + matchingState: 326, + pupilWaitingTimeAvg: 8.35097324007621, + studentWaitingTimeAvg: 51.64871701057732, matchRuns: 67, }, ], @@ -137,13 +137,13 @@ describe('Real World Matching Performance', () => { 'new', 1, { - matchCountSum: 1044, - matchCountAvg: 2.4110854503464205, - matchingSubjectsSum: 1795, - matchingSubjectsAvg: 1.7193486590038314, - matchingState: 323, - pupilWaitingTimeAvg: 17.05913367225194, - studentWaitingTimeAvg: 57.4907587186702, + matchCountSum: 1045, + matchCountAvg: 2.4133949191685913, + matchingSubjectsSum: 1706, + matchingSubjectsAvg: 1.632535885167464, + matchingState: 316, + pupilWaitingTimeAvg: 3.9678646337387073, + studentWaitingTimeAvg: 47.77617396444717, matchRuns: 433, }, ], diff --git a/common/match/matching.ts b/common/match/matching.ts index 8fa660da3..a65caa35f 100644 --- a/common/match/matching.ts +++ b/common/match/matching.ts @@ -142,16 +142,21 @@ export function matchScore(request: MatchRequest, offer: MatchOffer, currentDate // how good a match is in (0, 1) const score = 0.99 * subjectBonus + 0.01 * stateBonus; + // TODO: Prefer helpers that waited longer + + // TODO: Fix retention for matches with only few subjects (e.g. both helper and helpee only have math as subject) + // in that case the score is not so high, and thus they are retained for a long time, although the match is perfect + // Retention: Do not directly match not so perfect matches, // but let them wait for a few days, maybe a better match arrives - const offerWaitDays = (+currentDate - +offer.requestAt) / MS_PER_DAY; + /* const offerWaitDays = (+currentDate - +offer.requestAt) / MS_PER_DAY; const requestWaitDays = (+currentDate - +request.requestAt) / MS_PER_DAY; // Keep them at most for 3 weeks, and linearily increase the chance of getting matched const doRetention = requestWaitDays < 21; if (doRetention && score < 1 - requestWaitDays / 40) { return NO_MATCH; - } + } */ return score; }