1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//! Clean Vec<f64>-based multi-objective optimisation algorithms.
//!
//! This module provides self-contained, easy-to-use implementations of
//! multi-objective evolutionary algorithms that work directly with Rust
//! `Vec<f64>` slices — no ndarray wrappers required.
//!
//! # Modules
//!
//! | Module | Algorithm |
//! |--------|-----------|
//! | [`nsga2`] | NSGA-II — Non-dominated Sorting Genetic Algorithm II (Deb 2002) |
//! | [`nsga3`] | NSGA-III — Many-objective NSGA with reference-point niching (Deb 2014) |
//! | [`moead`] | MOEA/D — Decomposition-based MOEA (Zhang 2007) |
//! | [`pareto`] | Pareto dominance, ranking, hypervolume, and distance metrics |
//! | [`indicators`] | Quality indicators: HV, IGD, IGD+, GD, ε-indicator, R2, spacing |
//!
//! # Quick start
//!
//! ```rust
//! use scirs2_optimize::multiobjective::nsga2::{nsga2, Nsga2Config};
//!
//! // 2-variable, 2-objective ZDT1 benchmark
//! let bounds = vec![(0.0_f64, 1.0_f64); 5];
//! let mut cfg = Nsga2Config::default();
//! cfg.population_size = 20;
//! cfg.n_generations = 5;
//!
//! let result = nsga2(2, &bounds, |x| {
//! let f1 = x[0];
//! let g = 1.0 + 9.0 * x[1..].iter().sum::<f64>() / (x.len()-1) as f64;
//! vec![f1, g * (1.0 - (f1 / g).sqrt())]
//! }, cfg).expect("valid input");
//!
//! println!("Pareto front size: {}", result.pareto_front.len());
//! ```
//!
//! # Many-objective (≥ 4 objectives) example
//!
//! ```rust
//! use scirs2_optimize::multiobjective::nsga3::{nsga3, Nsga3Config};
//!
//! let n_obj = 4;
//! let bounds: Vec<(f64, f64)> = vec![(0.0, 1.0); n_obj + 3];
//! let mut cfg = Nsga3Config::default();
//! cfg.population_size = 30;
//! cfg.n_generations = 10;
//! cfg.n_divisions = 3;
//!
//! let result = nsga3(n_obj, &bounds, |x| {
//! let n = x.len();
//! let k = n - n_obj + 1;
//! let g: f64 = x[n-k..].iter().map(|&xi| (xi - 0.5).powi(2)).sum();
//! let mut f = vec![0.0f64; n_obj];
//! for i in 0..n_obj {
//! let mut val = 1.0 + g;
//! for j in 0..n_obj - 1 - i {
//! val *= (x[j] * std::f64::consts::FRAC_PI_2).cos();
//! }
//! if i > 0 { val *= (x[n_obj - 1 - i] * std::f64::consts::FRAC_PI_2).sin(); }
//! f[i] = val;
//! }
//! f
//! }, cfg).expect("valid input");
//!
//! println!("Reference points: {}", result.reference_points.len());
//! ```
// ── hypervolume module re-exports ────────────────────────────────────────────
pub use ;
// ── indicators module re-exports ──────────────────────────────────────────────
pub use ;
// ── MOEA/D re-exports ─────────────────────────────────────────────────────────
pub use ;
// ── NSGA-II re-exports ────────────────────────────────────────────────────────
pub use ;
// ── NSGA-III re-exports ───────────────────────────────────────────────────────
pub use ;
// ── pareto module re-exports ──────────────────────────────────────────────────
pub use ;