1 # Core + pass-2 facade. Importing this file is the module graph check: 2 # v0 selection, SBX / mutation, ZDT/DTLZ, tournament, Unsga3Algorithm.Run. 3 4 import Base 5 import ./individual.bend as Individual 6 import ./non_dominated_sort.bend as NonDominatedSort 7 import ./normalization.bend as Normalization 8 import ./reference_directions.bend as ReferenceDirections 9 import ./survival.bend as Survival 10 import ./util.bend as Util 11 import ./bounds.bend as Bounds 12 import ./rng.bend as Rng 13 import ./sbx.bend as Sbx 14 import ./polynomial_mutation.bend as Poly 15 import ./problems.bend as Problems 16 import ./tournament.bend as Tournament 17 import ./algorithm.bend as Algorithm 18 19 def core_modules_loaded() -> Bool: 20 True{} 21 22 def variation_defaults() -> F32 & F32 & F32: 23 (Sbx.eta(Sbx.default()), Sbx.probability(Sbx.default()), Poly.eta(Poly.default())) 24 25 def unit_box2() -> Bounds.Box: 26 Bounds.unit_n(2n, 2n) 27 28 def rng_seed1() -> Rng.State: 29 Rng.from_nat(1n) 30 31 def empty_fronts() -> List<&2, List<&2, Nat>>: 32 NonDominatedSort.sort(Nil{}) 33 34 def empty_normalized() -> Normalization.State & List<&2, List<&2, F32>>: 35 Normalization.normalize(Normalization.new_state(2n), Nil{}) 36 37 def das_dennis_m1() -> List<&2, List<&2, F32>>: 38 ReferenceDirections.das_dennis(1n, 1n) 39 40 def empty_selected() -> List<&2, Individual.Individual>: 41 Survival.select(Nil{}, 0n, Nil{}) 42 43 def count_m1() -> Nat: 44 Util.nat_min(ReferenceDirections.count(1n, 12n), 1n) 45 46 def zdt1_n_obj() -> Nat: 47 Problems.n_obj(Problems.zdt1(30n)) 48 49 def dtlz2_n_var() -> Nat: 50 Problems.n_var(Problems.dtlz2(3n, 10n)) 51 52 def empty_run() -> List<&2, Individual.Individual>: 53 Algorithm.run(Problems.zdt1(30n), Algorithm.mk(Nil{}, 0n, 0n, 1n, Tournament.pymoo(), True{})) 54 55 def parents_zero() -> List<&2, Individual.Individual>: 56 Tournament.parents_of(Tournament.select_parents(Tournament.pymoo(), Nil{}, 0n, Rng.from_nat(1n)))