def start

unified-nsga-iii@0.2.2.0 · polynomial_mutation.bend:139

import unified-nsga-iii@0.2.2.0/polynomial_mutation.bend as PolynomialMutation
import Base
import unified-nsga-iii@0.2.2.0/individual.bend as Ind
import unified-nsga-iii@0.2.2.0/bounds.bend as Bounds
import unified-nsga-iii@0.2.2.0/rng.bend as Rng

139def start(
140  +eta: F32,
141  +box: Bounds.Box,
142  rng: Rng.State,
143  +ind: Ind.Individual,
144  +p: F32,
145  n: Nat
146) -> Rng.State & Ind.Individual:
147  match n:
148    case 0n:
149      (rng, ind)
150    case 1n+f:
151      +rng2 = Rng.next_double(rng)
152      +xs = Ind.variables(ind)
153      +ivs = Bounds.intervals_of(box)
154      finish(
155        Ind.n_obj(ind),
156        loop.go(
157          1n+f,
158          skip_kind(F32.is_gt(Rng.last_double(rng2), p), tiny_head(ivs)),
159          xs, ivs, eta, rng2, Nil{}, p
160        )
161      )

Uses (18)

Used by (1)