Algorithm.wrap_pair.keep: def of unified-nsga-iii@0.2.2.0 Import: import unified-nsga-iii@0.2.2.0/algorithm.bend as Algorithm Lines 173-181 of unified-nsga-iii@0.2.2.0/algorithm.bend: https://jend.leeeet.dev/read.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&start_line=173&end_line=181 import Base # in_range: pair+1 < n → use `pair` (even-N sequence, and odd N before # the last parent). last: pair+1 == n → keep `pair` so parent N-1 # enters SBX. Otherwise reset to 0 (cursor already past the end). def wrap_pair.keep(+pair: Nat, last: Bool) -> Nat: match last: case True{}: pair case False{}: 0n Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat