Tournament.by_niche.eq: def of unified-nsga-iii@0.2.2.0 Import: import unified-nsga-iii@0.2.2.0/tournament.bend as Tournament Lines 99-106 of unified-nsga-iii@0.2.2.0/tournament.bend: https://jend.leeeet.dev/read.txt?path=unified-nsga-iii@0.2.2.0/tournament.bend&start_line=99&end_line=106 import Base import unified-nsga-iii@0.2.2.0/individual.bend as Ind import unified-nsga-iii@0.2.2.0/rng.bend as Rng # Equal niche counts fall through to perpendicular distance (then coin). # A count tie used to coin immediately and skip distance. def by_niche.eq(+a: Ind.Individual, +b: Ind.Individual, rng: Rng.State, same: Bool) -> Rng.State & Ind.Individual: match same: case True{}: by_dist(a, b, rng) case False{}: cmp_pick(a, b, rng, Nat.is_lt(Ind.niche(a), Ind.niche(b)), Nat.is_lt(Ind.niche(b), Ind.niche(a))) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=Individual https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=niche https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/rng.bend&name=State https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/tournament.bend&name=by_dist https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/tournament.bend&name=cmp_pick