Skip to content

Extension of the differential-evolution-rs repository by martinus. It uses the current version of the rand crate and adds epoch-wise solving instead of iterations. Moreover I introduce two submodules: The updates Self-Adaptive Differential Evolution (SDE) and an implementation of Success-History-based Adaption of Differential Evolution (SHADE).

License

Notifications You must be signed in to change notification settings

MKHoffmann/differential-evolution-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Differential Evolution Crates Version Build Status

Simple and powerful global optimization using a Self-Adapting Differential Evolution for Rust. See Wikipedia's article on Differential Evolution for more information.

Documentation: https://docs.rs/differential-evolution/*/differential_evolution/

Usage

Add this to your Cargo.toml:

[dependencies]
differential-evolution = "*"

and this to your crate root:

extern crate differential_evolution;

Examples

Differential Evolution is a global optimization algorithm that tries to iteratively improve candidate solutions with regards to a user-defined cost function.

This example finds the minimum of a simple 5-dimensional function.

extern crate differential_evolution;

use differential_evolution::self_adaptive_de;

fn main() {
    // create a self adaptive DE with an inital search area
    // from -10 to 10 in 5 dimensions.
    let mut de = self_adaptive_de(vec![(-10.0, 10.0); 5], |pos| {
        // cost function to minimize: sum of squares
        pos.iter().fold(0.0, |sum, x| sum + x*x)
    });

    // perform 10000 cost evaluations
    de.iter().nth(10000);

    // show the result
    let (cost, pos) = de.best().unwrap();
    println!("cost: {}", cost);
    println!("pos: {:?}", pos);
}

Similar Crates

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Extension of the differential-evolution-rs repository by martinus. It uses the current version of the rand crate and adds epoch-wise solving instead of iterations. Moreover I introduce two submodules: The updates Self-Adaptive Differential Evolution (SDE) and an implementation of Success-History-based Adaption of Differential Evolution (SHADE).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%