def offs_pair

unified-nsga-iii@0.2.2.0 · algorithm.bend:272

import unified-nsga-iii@0.2.2.0/algorithm.bend as Algorithm
import Base
import unified-nsga-iii@0.2.2.0/individual.bend as Ind
import unified-nsga-iii@0.2.2.0/rng.bend as Rng
import unified-nsga-iii@0.2.2.0/sbx.bend as Sbx
import unified-nsga-iii@0.2.2.0/problems.bend as Prob
import unified-nsga-iii@0.2.2.0/util.bend as Util

272def offs_pair(
273  +parents: List<&2, Ind.Individual>,
274  +pair: Nat,
275  +need: Nat,
276  +acc: List<&2, Ind.Individual>,
277  +seen: List<&2, List<&2, F32>>,
278  rng: Rng.State,
279  +prob: Prob.Problem,
280  +mut_p: F32,
281  +elim: Bool
282) -> Rng.State & Nat & List<&2, Ind.Individual> & List<&2, List<&2, F32>>:
283  +n = Util.list_len(Ind.Individual, parents)
284  +p0 = wrap_pair(pair, n)
285  offs_pair.sbx(
286    need,
287    acc,
288    seen,
289    prob,
290    mut_p,
291    elim,
292    Sbx.crossover(Sbx.default(), get_ind(parents, p0), get_ind(parents, pair_mate(p0, n)), Prob.box_of(prob), rng)
293  )

Uses (16)

Used by (1)