watchmaker

A genetic algorithm implementation in Rust.

CircleCI

Features

Usage

type MyGenome = String;

pub struct MySearchProblem { random: Random, }

impl MySearchProblem { pub fn new(random: Random) -> Self { Self { random } } }

impl Genetic for MySearchProblem { fn initialize(&mut self) -> MyGenome { unimplemented!(); }

fn evaluate(&mut self, genome: &MyGenome) -> f64 {
    unimplemented!();
}

fn crossover(&mut self, lhs: &MyGenome, rhs: &MyGenome) -> MyGenome {
    unimplemented!();
}

fn mutate(&mut self, original: &MyGenome) -> MyGenome {
    unimplemented!();
}

} See `WSGenome` and `WSGenetic` for a fully implemented, working example that finds a target string. * Call the `solver` method: rust pub fn search( mut genetic: Box>, mut progress: Option>, mut random: Random, settings: &Settings, ) -> Result, Failure> Example: rust let result = solve( mut genetic: Box::new(MySearchProblem::new(makerandom())), mut progress: None, makerandom(), &Settings::default(), ); println!("{:?}", result); ```

Development

Examples

See the examples folder.

Roadmap

Note major version increment with each major release. API changes will not be backwards compatible between major releases.

Alternatives

Contributing

Not accepting pull requests yet :) See roadmap.

License

MIT permissive license. See LICENSE for full license details.

Source Code Repository

https://github.com/thomasbratt/watchmaker