def normalize_mixed

unified-nsga-iii@0.2.2.0 · normalization.bend:611

import unified-nsga-iii@0.2.2.0/normalization.bend as Normalization
import Base
import unified-nsga-iii@0.2.2.0/individual.bend as Ind

611# Stats (ideal, worst, extremes, nadir) use the feasible subset.
612# Every member, including infeasible, is translated by that hyperplane.
613def normalize_mixed(state: State, +pop: List<&2, Ind.Individual>, nd: List<&2, Nat>) -> State & List<&2, List<&2, F32>>:
614  match state:
615    case MkState{n_objectives, ideal, worst, nadir, intercepts, extremes}:
616      +stat = feas_inds(pop)
617      +use = nd_mixed(pop, nd)
618      +mn = col_min(stat)
619      +mx = col_max(stat)
620      +ideal2 = merge_ideal(ideal, mn)
621      +worst2 = merge_worst(worst, mx)
622      +front = col_max_idx(pop, use)
623      +cand = List.append(&2, List<&2, F32>, extremes, gather_objs(pop, use))
624      +m = n_obj_pop(pop)
625      +ext = pick_extremes(cand, ideal2, m)
626      +nadir0 = nadir_from_maybe(try_intercepts(ext, ideal2), ideal2, worst2, front)
627      +nadir1 = fallback_pop(nadir0, ideal2, mx)
628      +nadir2 = fallback_unit(nadir1, ideal2)
629      (MkState{m, ideal2, worst2, nadir2, spans_or_one(nadir2, ideal2), ext}, map_norm(ideal2, nadir2, pop))

Uses (24)

Used by (1)