Skip to main content

Module mode

Module mode 

Source
Expand description

Multi-objective Differential Evolution (MODE).

Multi-objective / constrained Differential Evolution (DE/all/1) with an optional NSGA-II-style population update. Features enhanced multiple constraint ranking, oscillating CR/F, SBX + polynomial variation, mixed integer handling, and normalized all-objective crowding distance.

Ask/tell only (the caller evaluates objectives+constraints and feeds them back), so the optimizer can drive Rust threads, a GPU batch, or an external evaluator without embedding a callback.

§References

§Example

use fcmaes_core::{Fitness, Mode, ModeParams};

let fit = Fitness::bounded(2, 2, &[0.0; 2], &[2.0; 2]);
let mut mode = Mode::new(fit, 2, 0, None, &ModeParams::default());
for _ in 0..5 {
    let xs = mode.ask();
    let ys: Vec<Vec<f64>> = xs
        .iter()
        .map(|x| vec![
            x.iter().map(|v| v * v).sum(),
            x.iter().map(|v| (v - 2.0).powi(2)).sum(),
        ])
        .collect();
    mode.tell(&ys);
}
assert_eq!(mode.population().len(), mode.popsize());

Structs§

Mode
Stateful constrained MODE optimizer.
ModeParams
Tunable inputs for Mode::new.
ModeResult
Outcome/result snapshot of a MODE run.