Survival.associate_raw.go: def of unified-nsga-iii@0.2.2.0 Import: import unified-nsga-iii@0.2.2.0/survival.bend as Survival Lines 271-295 of unified-nsga-iii@0.2.2.0/survival.bend: https://jend.leeeet.dev/read.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&start_line=271&end_line=295 import Base import unified-nsga-iii@0.2.2.0/individual.bend as Ind import unified-nsga-iii@0.2.2.0/util.bend as Util # Nearest-ref per individual is independent given dirs. Mid-split pop and F. def associate_raw.go( +dirs: List<&2, List<&2, F32>>, +fuel: Nat, pop: List<&2, Ind.Individual>, +F: List<&2, List<&2, F32>> ) -> List<&2, Assignment>: match fuel pop: case 0n Nil{}: Nil{} case 0n ind <> rest: match F: case Nil{}: nearest_one(Ind.objectives(ind), dirs) <> associate_raw.go(dirs, 0n, rest, Nil{}) case f <> fs: nearest_one(f, dirs) <> associate_raw.go(dirs, 0n, rest, fs) case 1n+p Nil{}: Nil{} case 1n+p ind <> Nil{}: associate_head(dirs, ind, F) <> Nil{} case 1n+p h <> t: +all = {h <> t : List<&2, Ind.Individual>} +mid = Nat.div(Util.list_len(Ind.Individual, all), 2n) lo hi = associate_raw.go(dirs, p, List.take(&2, Ind.Individual, all, mid), List.take(&2, List<&2, F32>, F, mid)) associate_raw.go(dirs, p, List.drop(&2, Ind.Individual, all, mid), List.drop(&2, List<&2, F32>, F, mid)) List.append(&2, Assignment, lo, hi) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.take https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div 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=objectives https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=Assignment https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=associate_head https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=nearest_one https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/util.bend&name=list_len