unified-nsga-iii Releases (4): 0.2.2.0 0xd1de66b5d9157913a654c39186289f3d indexed https://jend.leeeet.dev/files.txt?path=unified-nsga-iii@0.2.2.0 0.2.1.0 0x2bc7fb472c80bd6a0e04725c117edb2a unindexed https://jend.leeeet.dev/files.txt?path=unified-nsga-iii@0.2.1.0 0.2.0.0 0xa2f9d6ef8c474468bf1de15ebe70c512 unindexed https://jend.leeeet.dev/files.txt?path=unified-nsga-iii@0.2.0.0 0.1.2.0 0x527a2a4fa91b05a0250d7be0e11d232a unindexed https://jend.leeeet.dev/files.txt?path=unified-nsga-iii@0.1.2.0 Definitions (702, 1 to 100 shown): Algorithm.Config (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=Config) type Config is Data: MkConfig{ dirs: List<&2, List<&2, F32>> pop_size: Nat gens: Nat seed: Nat mode: Tour.Mode elim_dups: Bool } Algorithm.mk (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=mk) def mk(+dirs: List<&2, List<&2, F32>>, +pop_size: Nat, +gens: Nat, +seed: Nat, +mode: Tour.Mode, +elim_dups: Bool) -> Config: Algorithm.cfg_dirs (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=cfg_dirs) def cfg_dirs(c: Config) -> List<&2, List<&2, F32>>: Algorithm.cfg_pop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=cfg_pop) def cfg_pop(c: Config) -> Nat: Algorithm.cfg_gens (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=cfg_gens) def cfg_gens(c: Config) -> Nat: Algorithm.cfg_seed (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=cfg_seed) def cfg_seed(c: Config) -> Nat: Algorithm.cfg_mode (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=cfg_mode) def cfg_mode(c: Config) -> Tour.Mode: Algorithm.cfg_elim (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=cfg_elim) def cfg_elim(c: Config) -> Bool: Algorithm.smoke_zdt1 (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=smoke_zdt1) # Smoke (not oracle): ZDT1 n=30, partitions=4 → 5 refs, pop=8, gens=3, seed=1. def smoke_zdt1() -> Config: Algorithm.oracle_zdt1 (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=oracle_zdt1) # C# OracleCompare / EQUIVALENCE-style settings (not the smoke default). def oracle_zdt1() -> Config: Algorithm.oracle_dtlz2 (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=oracle_dtlz2) def oracle_dtlz2() -> Config: Algorithm.get_ind (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=get_ind) def get_ind(+pop: List<&2, Ind.Individual>, i: Nat) -> Ind.Individual: Algorithm.rand_xs.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=rand_xs.go) def rand_xs.go(+box: Bounds.Box, fuel: Nat, +i: Nat, rng: Rng.State, acc: List<&2, F32>) -> Rng.State & List<&2, F32>: Algorithm.rand_xs (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=rand_xs) def rand_xs(+box: Bounds.Box, rng: Rng.State) -> Rng.State & List<&2, F32>: Algorithm.IHold (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=IHold) type IHold is Data: IH{ rng: Rng.State acc: List<&2, Ind.Individual> } Algorithm.init_next.xs (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=init_next.xs) def init_next.xs(+n_obj: Nat, acc: List<&2, Ind.Individual>, pair: Rng.State & List<&2, F32>) -> IHold: Algorithm.init_next (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=init_next) def init_next(+box: Bounds.Box, +n_obj: Nat, hold: IHold) -> IHold: Algorithm.init_loop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=init_loop) def init_loop(fuel: Nat, hold: IHold, +box: Bounds.Box, +n_obj: Nat) -> Rng.State & List<&2, Ind.Individual>: Algorithm.init_pop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=init_pop) def init_pop(+prob: Prob.Problem, n: Nat, rng: Rng.State) -> Rng.State & List<&2, Ind.Individual>: Algorithm.vars_of.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=vars_of.go) def vars_of.go(xs: List<&2, Ind.Individual>, acc: List<&2, List<&2, F32>>) -> List<&2, List<&2, F32>>: Algorithm.vars_of (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=vars_of) def vars_of(xs: List<&2, Ind.Individual>) -> List<&2, List<&2, F32>>: Algorithm.try_add.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=try_add.go) def try_add.go(+acc: List<&2, Ind.Individual>, +child: Ind.Individual, +seen: List<&2, List<&2, F32>>, +key: List<&2, F32>, skip: Bool) -> List<&2, Ind.Individual> & List<&2, List<&2, F32>> & Bool: Algorithm.try_add (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=try_add) def try_add(+acc: List<&2, Ind.Individual>, +child: Ind.Individual, +seen: List<&2, List<&2, F32>>, elim: Bool) -> List<&2, Ind.Individual> & List<&2, List<&2, F32>> & Bool: Algorithm.pred_or_zero (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=pred_or_zero) def pred_or_zero(n: Nat) -> Nat: Algorithm.dec_if (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=dec_if) def dec_if(n: Nat, hit: Bool) -> Nat: Algorithm.wrap_pair.keep (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=wrap_pair.keep) # 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: Algorithm.wrap_pair.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=wrap_pair.go) def wrap_pair.go(+pair: Nat, in_range: Bool, last: Bool) -> Nat: Algorithm.wrap_pair (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=wrap_pair) def wrap_pair(+pair: Nat, +n: Nat) -> Nat: Algorithm.pair_mate.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=pair_mate.go) # Second parent. In range: pair+1. At the end (odd N, first parent is # N-1): parent 0. Even N never asks for a mate past N-1. def pair_mate.go(+i: Nat, ok: Bool) -> Nat: Algorithm.pair_mate (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=pair_mate) def pair_mate(+p0: Nat, +n: Nat) -> Nat: Algorithm.dup_fallback_cap (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=dup_fallback_cap) # C# fallback cap: max(pop * 20, 1). Unique-key stage before duplicates. def dup_fallback_cap(n: Nat) -> Nat: Algorithm.FHold (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=FHold) type FHold is Data: FH{ rng: Rng.State acc: List<&2, Ind.Individual> } Algorithm.fallback_next.m (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=fallback_next.m) def fallback_next.m(acc: List<&2, Ind.Individual>, pair: Rng.State & Ind.Individual) -> FHold: Algorithm.fallback_next (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=fallback_next) def fallback_next(+parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, hold: FHold) -> FHold: Algorithm.fallback_loop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=fallback_loop) def fallback_loop(need: Nat, hold: FHold, +parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32) -> Rng.State & List<&2, Ind.Individual>: Algorithm.offs_add2.hit (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_add2.hit) def offs_add2.hit(+need1: Nat, trip: List<&2, Ind.Individual> & List<&2, List<&2, F32>> & Bool) -> Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_add2.rest (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_add2.rest) def offs_add2.rest(+need1: Nat, +elim: Bool, +c2: Ind.Individual, acc1: List<&2, Ind.Individual>, seen1: List<&2, List<&2, F32>>, done: Bool) -> Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_add2 (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_add2) def offs_add2( +need: Nat, acc: List<&2, Ind.Individual>, seen: List<&2, List<&2, F32>>, +elim: Bool, +c2: Ind.Individual, trip: List<&2, Ind.Individual> & List<&2, List<&2, F32>> & Bool ) -> Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_pair.done (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_pair.done) def offs_pair.done(rng3: Rng.State, trip: Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>) -> Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_pair.m2 (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_pair.m2) def offs_pair.m2(+need: Nat, +acc: List<&2, Ind.Individual>, +seen: List<&2, List<&2, F32>>, +elim: Bool, +m1: Ind.Individual, pair: Rng.State & Ind.Individual) -> Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_pair.m1 (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_pair.m1) def offs_pair.m1(+need: Nat, +acc: List<&2, Ind.Individual>, +seen: List<&2, List<&2, F32>>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool, +c2: Ind.Individual, pair: Rng.State & Ind.Individual) -> Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_pair.sbx (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_pair.sbx) def offs_pair.sbx(+need: Nat, +acc: List<&2, Ind.Individual>, +seen: List<&2, List<&2, F32>>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool, trip: Rng.State & Ind.Individual & Ind.Individual) -> Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.offs_pair (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_pair) def offs_pair( +parents: List<&2, Ind.Individual>, +pair: Nat, +need: Nat, +acc: List<&2, Ind.Individual>, +seen: List<&2, List<&2, F32>>, rng: Rng.State, +prob: Prob.Problem, +mut_p: F32, +elim: Bool ) -> Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>: Algorithm.OHold (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=OHold) type OHold is Data: OH{ need: Nat pair: Nat rng: Rng.State acc: List<&2, Ind.Individual> seen: List<&2, List<&2, F32>> } Algorithm.offs_next.q (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_next.q) def offs_next.q(+pair0: Nat, quad: Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>) -> OHold: Algorithm.offs_next (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_next) def offs_next(+parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool, hold: OHold) -> OHold: Algorithm.UHold (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=UHold) # Middle loop: mutation that must still be a new key. `need` is the # remaining slots. Cap is max(pop*20, 1), counted in `fuel`. type UHold is Data: UH{ rng: Rng.State acc: List<&2, Ind.Individual> seen: List<&2, List<&2, F32>> need: Nat } Algorithm.u_have (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_have) def u_have(hold: UHold) -> Rng.State & List<&2, Ind.Individual>: Algorithm.u_fallback (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_fallback) def u_fallback(+parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, hold: UHold) -> Rng.State & List<&2, Ind.Individual>: Algorithm.u_step.hold (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_step.hold) def u_step.hold(+rng: Rng.State, +need: Nat, trip: List<&2, Ind.Individual> & List<&2, List<&2, F32>> & Bool) -> UHold: Algorithm.u_step.child (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_step.child) def u_step.child(+elim: Bool, +acc: List<&2, Ind.Individual>, +seen: List<&2, List<&2, F32>>, +need: Nat, +rng: Rng.State, +child: Ind.Individual) -> UHold: Algorithm.u_step (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_step) def u_step(+elim: Bool, +acc: List<&2, Ind.Individual>, +seen: List<&2, List<&2, F32>>, +need: Nat, pair: Rng.State & Ind.Individual) -> UHold: Algorithm.u_next (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_next) def u_next(+parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool, hold: UHold) -> UHold: Algorithm.u_loop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=u_loop) def u_loop( fuel: Nat, hold: UHold, +parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool ) -> Rng.State & List<&2, Ind.Individual>: Algorithm.offs_done (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_done) def offs_done(+parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool, +n: Nat, hold: OHold) -> Rng.State & List<&2, Ind.Individual>: Algorithm.offs_have (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_have) def offs_have(hold: OHold) -> Rng.State & List<&2, Ind.Individual>: Algorithm.offs_loop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=offs_loop) def offs_loop( fuel: Nat, hold: OHold, +parents: List<&2, Ind.Individual>, +prob: Prob.Problem, +mut_p: F32, +elim: Bool, +n: Nat ) -> Rng.State & List<&2, Ind.Individual>: Algorithm.seen_start (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=seen_start) # Hash the survivor population (not the mating sample). An individual # who lost every tournament is still a duplicate of P. def seen_start(+survivors: List<&2, Ind.Individual>, elim: Bool) -> List<&2, List<&2, F32>>: Algorithm.create_offspring (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=create_offspring) def create_offspring( +prob: Prob.Problem, +survivors: List<&2, Ind.Individual>, +parents: List<&2, Ind.Individual>, +n: Nat, rng: Rng.State, +elim: Bool ) -> Rng.State & List<&2, Ind.Individual>: Algorithm.nd_front (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=nd_front) def nd_front(+pop: List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.feas_only.on (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=feas_only.on) # Rank 0 is feasible whenever any feasible member exists (Deb). # An all-infeasible front becomes empty here so a dump can skip it. def feas_only.on(+h: Ind.Individual, rest: List<&2, Ind.Individual>, feas: Bool) -> List<&2, Ind.Individual>: Algorithm.feas_only (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=feas_only) def feas_only(xs: List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.feas_nd (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=feas_nd) def feas_nd(+pop: List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.emit_front (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=emit_front) def emit_front(xs: List<&2, Ind.Individual>) -> IO(Unit): Algorithm.GHold (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=GHold) type GHold is Data: GH{ st: Norm.State xs: List<&2, Ind.Individual> rng: Rng.State } Algorithm.one_gen.prep (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=one_gen.prep) def one_gen.prep(+rng: Rng.State, pair: Norm.State & List<&2, Ind.Individual>) -> GHold: Algorithm.one_gen.s (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=one_gen.s) def one_gen.s(+prob: Prob.Problem, +cfg: Config, trip: Norm.State & List<&2, Ind.Individual> & Rng.State) -> GHold: Algorithm.one_gen.o (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=one_gen.o) def one_gen.o(+prob: Prob.Problem, +cfg: Config, +pop: List<&2, Ind.Individual>, +state: Norm.State, trip: Rng.State & List<&2, Ind.Individual>) -> GHold: Algorithm.one_gen.p (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=one_gen.p) def one_gen.p(+prob: Prob.Problem, +cfg: Config, +pop: List<&2, Ind.Individual>, +state: Norm.State, trip: Rng.State & List<&2, Ind.Individual>) -> GHold: Algorithm.one_gen (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=one_gen) def one_gen(+prob: Prob.Problem, +cfg: Config, hold: GHold) -> GHold: Algorithm.gen_pop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=gen_pop) def gen_pop(hold: GHold) -> List<&2, Ind.Individual>: Algorithm.gen_loop (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=gen_loop) def gen_loop(fuel: Nat, hold: GHold, +prob: Prob.Problem, +cfg: Config) -> List<&2, Ind.Individual>: Algorithm.run.after_prep (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run.after_prep) def run.after_prep(+prob: Prob.Problem, +cfg: Config, rng: Rng.State, pair: Norm.State & List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.run.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run.go) def run.go(+prob: Prob.Problem, +cfg: Config, pair: Rng.State & List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.run.sized (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run.sized) def run.sized(+prob: Prob.Problem, +cfg: Config, n: Nat) -> List<&2, Ind.Individual>: Algorithm.run (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run) def run(+prob: Prob.Problem, +cfg: Config) -> List<&2, Ind.Individual>: Algorithm.replace_head (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=replace_head) # Replace the first random member with `seed_x` before evaluate. # The rest of the initial population still consumes the seed RNG. # C# places the seed first and does not draw RNG for it; this helper # only guarantees a known feasible start for the constrained smoke. def replace_head(+xs: List<&2, F32>, +nm: Nat, pop: List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.run_seeded.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run_seeded.go) def run_seeded.go(+prob: Prob.Problem, +cfg: Config, +seed_x: List<&2, F32>, pair: Rng.State & List<&2, Ind.Individual>) -> List<&2, Ind.Individual>: Algorithm.run_seeded.sized (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run_seeded.sized) def run_seeded.sized(+prob: Prob.Problem, +cfg: Config, +seed_x: List<&2, F32>, n: Nat) -> List<&2, Ind.Individual>: Algorithm.run_seeded (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run_seeded) def run_seeded(+prob: Prob.Problem, +cfg: Config, +seed_x: List<&2, F32>) -> List<&2, Ind.Individual>: Algorithm.run_zdt1_smoke (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/algorithm.bend&name=run_zdt1_smoke) def run_zdt1_smoke() -> List<&2, Ind.Individual>: Bounds.Interval (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=Interval) type Interval is Data: MkInterval{ low: F32 high: F32 } Bounds.Box (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=Box) type Box is Data: MkBox{ m: Nat ivs: List<&2, Interval> } Bounds.interval (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=interval) def interval(+low: F32, +high: F32) -> Interval: Bounds.lo (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=lo) def lo(b: Interval) -> F32: Bounds.hi (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=hi) def hi(b: Interval) -> F32: Bounds.box (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=box) def box(+m: Nat, ivs: List<&2, Interval>) -> Box: Bounds.n_obj (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=n_obj) def n_obj(b: Box) -> Nat: Bounds.intervals_of (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=intervals_of) def intervals_of(b: Box) -> List<&2, Interval>: Bounds.n_var (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=n_var) def n_var(b: Box) -> Nat: Bounds.at.go (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=at.go) def at.go(m: Maybe<&2, Interval>) -> Interval: Bounds.at (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=at) def at(b: Box, i: Nat) -> Interval: Bounds.unit_n (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=unit_n) # nv copies of [0, 1]. Smoke / operator tests; unit ZDT / DTLZ boxes. def unit_n(nv: Nat, nm: Nat) -> Box: Bounds.span_n (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/bounds.bend&name=span_n) # nv copies of [low, high]. Sphere / Ackley / Rosenbrock and any uniform range. def span_n(nv: Nat, nm: Nat, +low: F32, +high: F32) -> Box: Individual.Individual (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=Individual) type Individual is Data: MkIndividual{ x: List<&2, F32> f: List<&2, F32> g: List<&2, F32> cv: F32 rnk: Nat nic: Nat aref: Nat dist: F32 ev: Bool … Individual.pos_part (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=pos_part) def pos_part(+x: F32) -> F32: Individual.sum_pos (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=sum_pos) # Sum of g_i where g_i > 0. Non-positive parts add nothing. def sum_pos(xs: List<&2, F32>) -> F32: Individual.from_objectives (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=from_objectives) # v0 / A/B path: objectives already known; no decision vector. # No constraints → cv 0 (feasible). def from_objectives(+f: List<&2, F32>) -> Individual: Individual.from_variables (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=from_variables) # Unevaluated candidate: variables set, objectives zeroed (C# ctor). # Constraints empty until a problem writes them. def from_variables(+x: List<&2, F32>, n_obj: Nat) -> Individual: Individual.variables (https://jend.leeeet.dev/definition.txt?path=unified-nsga-iii@0.2.2.0/individual.bend&name=variables) def variables(ind: Individual) -> List<&2, F32>: More: https://jend.leeeet.dev/packages/unified-nsga-iii.txt?definitions_offset=100