Survival.fill: def of unified-nsga-iii@0.2.2.0 Import: import unified-nsga-iii@0.2.2.0/survival.bend as Survival Lines 679-705 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=679&end_line=705 import Base import unified-nsga-iii@0.2.2.0/util.bend as Util def fill(fuel: Nat, fronts: List<&2, List<&2, Nat>>, fits: Bool, +acc: List<&2, Nat>, +target: Nat, +asgs: List<&2, Assignment>, +n_dirs: Nat) -> List<&2, Nat>: match fuel fronts fits: case 0n fs p: acc case f Nil{} p: acc case 1n+f +fr <> +rest False{}: +need = Nat.sub(target, Util.list_len(Nat, acc)) +rows = nrows_of(asgs, fr) niche_loop( 1n+Util.list_len(NRow, rows), need, rows, seed_counts(asgs, acc, Util.zeros_nat(n_dirs)), acc ) case 1n+f +fr <> +rest True{}: +new_acc = List.append(&2, Nat, acc, fr) fill( f, rest, Nat.is_le(Nat.add(Util.list_len(Nat, new_acc), head_len(rest)), target), new_acc, target, asgs, n_dirs ) Uses (15): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub 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=NRow https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=head_len https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=niche_loop https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=nrows_of https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/survival.bend&name=seed_counts https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/util.bend&name=list_len https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/util.bend&name=zeros_nat