From 20fdde7f5f5dafb6e5ad1650f998ecc47c83e6c1 Mon Sep 17 00:00:00 2001 From: xenofem Date: Thu, 9 Jul 2020 02:42:55 -0400 Subject: [PATCH] shuffle order of pairs within schedule --- waggle-dance.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/waggle-dance.py b/waggle-dance.py index 2ae078c..c9e5529 100755 --- a/waggle-dance.py +++ b/waggle-dance.py @@ -87,6 +87,9 @@ def matchings(l): random.shuffle(result) for i in range(len(result)): random.shuffle(result[i]) + for j in len(result[i]): + if random.randrange(2) == 0: + result[i][j] = (result[i][j][1], result[i][j][0]) result = [matching for matching in result if all((min(match[0].id,match[1].id), max(match[0].id,match[1].id)) not in block_pairs for match in matching)] return result