@@ -7,8 +7,8 @@ use ndarray::{Array2, Axis, stack};
77
88use moors:: {
99 CloseDuplicatesCleaner , DanAndDenisReferencePoints , GaussianMutation , Nsga3Builder ,
10- Nsga3ReferencePoints , Nsga3ReferencePointsSurvival , RandomSamplingFloat ,
11- SimulatedBinaryCrossover , StructuredReferencePoints , impl_constraints_fn,
10+ Nsga3ReferencePointsSurvival , RandomSamplingFloat , SimulatedBinaryCrossover ,
11+ StructuredReferencePoints , impl_constraints_fn,
1212} ;
1313
1414/// DTLZ2 for 3 objectives (m = 3) with k = 0 (so num_vars = m−1 = 2):
@@ -34,8 +34,7 @@ fn fitness_dtlz2_3obj(pop: &Array2<f64>) -> Array2<f64> {
3434
3535fn bench_nsga3_dtlz2 ( c : & mut Criterion ) {
3636 // 1) prepare 3-objective reference points once
37- let base_rp = DanAndDenisReferencePoints :: new ( 1000 , 3 ) . generate ( ) ;
38- let nsga3_rp = Nsga3ReferencePoints :: new ( base_rp, false ) ;
37+ let rp = DanAndDenisReferencePoints :: new ( 1000 , 3 ) . generate ( ) ;
3938 impl_constraints_fn ! ( MyConstr , lower_bound = 0.0 , upper_bound = 1.0 ) ;
4039
4140 c. bench_function ( "nsga3_dtlz2_3obj" , |b| {
@@ -45,7 +44,8 @@ fn bench_nsga3_dtlz2(c: &mut Criterion) {
4544 . sampler ( RandomSamplingFloat :: new ( 0.0 , 1.0 ) )
4645 . crossover ( SimulatedBinaryCrossover :: new ( 20.0 ) )
4746 . mutation ( GaussianMutation :: new ( 0.05 , 0.1 ) )
48- . survivor ( Nsga3ReferencePointsSurvival :: new ( nsga3_rp. clone ( ) ) )
47+ . reference_points ( rp. clone ( ) )
48+ . are_aspirational ( false )
4949 . duplicates_cleaner ( CloseDuplicatesCleaner :: new ( 1e-6 ) )
5050 . fitness_fn ( fitness_dtlz2_3obj)
5151 . constraints_fn ( MyConstr )
@@ -63,7 +63,7 @@ fn bench_nsga3_dtlz2(c: &mut Criterion) {
6363
6464 algorithm. run ( ) . expect ( "NSGA3 run failed" ) ;
6565 // prevent optimizer from eliding the result
66- black_box ( algorithm. population ( ) . expect ( "Population getter failed" ) ) ;
66+ black_box ( algorithm. population . expect ( "Population getter failed" ) ) ;
6767 } )
6868 } ) ;
6969}
0 commit comments