def pair_mate.go

unified-nsga-iii@0.2.2.0 · algorithm.bend:193

import unified-nsga-iii@0.2.2.0/algorithm.bend as Algorithm
import Base

193# Second parent. In range: pair+1. At the end (odd N, first parent is
194# N-1): parent 0. Even N never asks for a mate past N-1.
195def pair_mate.go(+i: Nat, ok: Bool) -> Nat:
196  match ok:
197    case True{}:
198      i
199    case False{}:
200      0n

Uses (2)

Used by (1)