diff --git a/src/model/model.class.ts b/src/model/model.class.ts index 0755b10..2961213 100644 --- a/src/model/model.class.ts +++ b/src/model/model.class.ts @@ -283,11 +283,11 @@ export class Model { return this.mutatePermutation(); } - const partner = min + 1 == max ? min : Paul.chooseBetween(max, min, BIAS.REVERSE_BELL); - if (chosen == partner) { - // would that ever happen ? - return this.mutatePermutation(); + let partner = min + 1 == max ? min : Paul.chooseBetween(max, min, BIAS.REVERSE_BELL); + while (chosen == partner) { + partner = Paul.chooseBetween(max, min, BIAS.REVERSE_BELL); } + const [a] = Model._order.splice(chosen, 1); const b = Model._order[partner];