def replace_head
import unified-nsga-iii@0.2.2.0/algorithm.bend as Algorithmimport Base
import unified-nsga-iii@0.2.2.0/individual.bend as Ind
522# Replace the first random member with `seed_x` before evaluate.
523# The rest of the initial population still consumes the seed RNG.
524# C# places the seed first and does not draw RNG for it; this helper
525# only guarantees a known feasible start for the constrained smoke.
526def replace_head(+xs: List<&2, F32>, +nm: Nat, pop: List<&2, Ind.Individual>) -> List<&2, Ind.Individual>:
527 match pop:
528 case Nil{}:
529 Nil{}
530 case h <> t:
531 Ind.from_variables(xs, nm) <> t