Skip to content

Commit 33424ab

Browse files
committed
Skip global scoring for large PNW clusters
1 parent a998b3c commit 33424ab

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/lib/recipes/steps/pnw.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { StepDefinition } from '../types';
33
const PNW_BALANCED_GROUP_SIZE_WEIGHT = 20;
44
const PNW_GLOBAL_SCORE = {
55
maxPasses: 1,
6-
maxEvaluations: 1200,
6+
maxEvaluations: 250,
7+
maxClusterSize: 80,
78
};
89

910
export const GenerateCompetitorAssignmentsForStaff: StepDefinition = {
@@ -286,7 +287,6 @@ export const GenerateJudgeAssignmentsForCompetitors: StepDefinition = {
286287
options: {
287288
mode: 'symmetric',
288289
},
289-
globalScore: PNW_GLOBAL_SCORE,
290290
constraints: [
291291
{
292292
constraint: 'uniqueAssignment',

src/lib/recipes/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface AssignmentStep {
4242
globalScore?: {
4343
maxPasses?: number;
4444
maxEvaluations?: number;
45+
maxClusterSize?: number;
4546
};
4647
};
4748
}

src/store/reducers/runRecipe.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ export function runRecipe(state: AppState, action: RunRecipePayload): AppState {
6464
return generatedWcif;
6565
}
6666

67+
if (
68+
hydratedStep.props.globalScore.maxClusterSize &&
69+
hydratedStep.props.cluster.length > hydratedStep.props.globalScore.maxClusterSize
70+
) {
71+
return generatedWcif;
72+
}
73+
6774
return optimizeAssignmentsGlobally({
6875
beforeWcif: accWcif,
6976
wcif: generatedWcif,

0 commit comments

Comments
 (0)