Skip to main content

Crate l_srtde

Crate l_srtde 

Source
Expand description

§L-SRTDE

A Rust implementation of Large Scale Random Topology Differential Evolution for large-scale numerical optimization problems.

The solver evaluates the population in parallel with rayon and adapts the scaling factor F using the success rate of the current generation.

§Chinese Documentation

简体中文说明见 README.zh-CN.md

§Soft Evaluation Budget

with_max_evaluations() configures a soft budget, not a strict hard limit. The solver always evaluates the full initial population first, and each generation evaluates a full batch of trial vectors in parallel before the budget check is applied to accepted children. As a result, the total number of calls to Problem::evaluate may exceed the configured value.

§Quick Start

use l_srtde::{Lsrtde, Problem};

struct SphereProblem {
    dim: usize,
}

impl Problem for SphereProblem {
    fn dimension(&self) -> usize {
        self.dim
    }

    fn get_bounds(&self, _index: usize) -> (f64, f64) {
        (-100.0, 100.0)
    }

    fn evaluate(&self, genome: &[f64]) -> f64 {
        genome.iter().map(|x| x * x).sum()
    }
}

let problem = SphereProblem { dim: 100 };
let solver = Lsrtde::new(&problem)
    .with_max_evaluations(500_000)
    .with_seed(42);

let solution = solver.run().unwrap();
assert!(solution.fitness < 1e-5);

Modules§

ffi
Low-level C ABI interface.

Structs§

Lsrtde
L-SRTDE solver.
Solution
The best solution found by the solver.

Enums§

LsrtdeError
Errors returned when the solver configuration is invalid.

Traits§

Problem
Defines an optimization problem that can be solved by Lsrtde.