Skip to content

Commit

Permalink
shuffle on every iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
inker committed Jul 3, 2024
1 parent d2e2492 commit 1430fca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/engine/dfs/ls/generatePairings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ export default async function* generatePairings<T>({

allGames = allGames.filter(([h, a]) => isMatchPossible(teams[h], teams[a]));

allGames = shuffle(allGames);

console.log('initial games', allGames.length, JSON.stringify(allGames));

const matches: (readonly [number, number])[] = [];

while (matches.length < numMatchdays * numGamesPerMatchday) {
allGames = shuffle(allGames);
// eslint-disable-next-line no-await-in-loop
const pickedMatch = await getFirstSuitableMatch({
// @ts-expect-error Fix this later
Expand Down

0 comments on commit 1430fca

Please sign in to comment.