#compile-time #genetic-algorithm #genetic #evolution #evolutionary #check #requirements

nightly meiosis

An evolutionary algorithm library with as many compile time checks as possible

2 unstable releases

0.1.0 Oct 22, 2022
0.0.0 Jan 24, 2022

#831 in Algorithms

Custom license

215KB
4K SLoC

Meiosis

Docs Crates.io License Deps.rs Build Status Code Coverage Contributors

Overview

Current Status

At the moment this crate is still in its early stages. There's a nightly requirement for features, very unstable APIs and nothing should be considered unchanging. I don't even know what to put in this README yet. It should also be noted that I use this library to learn API design and dive deeper into evolutionary algorithms - in the future I also want to tackle neuroevolution.

Goals

This library arose from the fact, that a lot of libraries out there do not leverage compile time evaluated invariants leading to the underlying code constantly verifying those iteration over iteration, resulting in ever so slightly less performance.

Because evolutionary algorithms take quite a long time to evolve, it is very annoying if there's a bug or runtime error. To combat that, algorithms in this library are written in such a way that most if not all components are evaluated at compile time. If that should not be possible, there will at least be assertions, so that any problem should come up very early, and not possibly hours into the evolution.

Methods to reach compile time evaluation consist of using state machines, arrays where possible and setting configuration options before entering main loops, so that any branches can be eliminated upon compilation, as the compiler should hopefully notice that those values can not change anymore once set.

Components

Components in this library are written in such a way, that they should be plug-and-playable with all available algorithms that use them. Generic parameters together with these components (e.g. selection, mutation) should result in the Rust compiler being able to infer most if not all types.

Of course, should you decide to write your own algorithm, these can still be used freely. If there is a requirement for you, like a trait signature change, to make things work, do not hesitate to open an issue! I would love to see more use-cases that I may not have thought about when designing the API.

Algorithms

Algorithms provided in this library have been developed mostly without an associated paper describing how they should work. My main goal was to understand their functionality and then to implement it in a rather naive way. The result is code that should hopefully be easy to read and understand.

Notes

Special Thanks

I'm terrible at thinking of names for my projects, so thank you, Patrick Harden for coming up with Meiosis.

The name of this crate was originally registered by Tim Byrne on crates.io. Thank you so much for transfering ownership!

Originally met through the Saltwater project, I would like to thank Andrei and Julia for their continued support in the prototyping phase. They were my rubber ducks and sample size of two for all things "what would users of the library like".

A ton of inspiration was taken from the following crates on how to solve certain problems, be it algorithms, library layout or examples. A big thank you to the authors and contributors of these crates:

If you feel like I forgot to mention you, please leave me a message or open a (confidential) issue. Any inspiration and help I got is as much part of this library as my own

Dependencies

~310KB