5 releases

new 0.1.32 Sep 6, 2025
0.1.31 Sep 5, 2025
0.1.3 Sep 5, 2025
0.1.2 Oct 7, 2021
0.1.0 Oct 1, 2021

#144 in Simulation

Download history 346/week @ 2025-09-03

346 downloads per month

MIT license

93KB
1.5K SLoC

GEMLA - Genetically Evolved Machine Learning Algorithms

Using evolutionary computation to generate machine learning algorithms.

TBC


lib.rs:

Gemla

Gemla is a Rust library for simulating and evolving populations using genetic algorithms. It provides a flexible framework for evolutionary computation, supporting custom node types, tournament bracket simulations, and persistent state management.

Features

  • Tournament-style genetic algorithm simulation evaluating populations via nodes
  • Asynchronous and concurrent simulation using Tokio
  • Customizable node logic via the GeneticNode trait
  • Persistent, file-backed simulation state with the file_linked crate
  • Utilities for binary tree management

Modules

  • tree: Defines an unbalanced binary tree structure and macros for tree construction.
  • core: Contains the main simulation logic, including the Gemla struct, configuration, and node management.
  • error: Provides unified error types and logging utilities for the crate.

Example


#[derive(Clone, Debug)]
struct MyNode { /* ... */ }
// Implement GeneticNode for MyNode...

#[tokio::main]
async fn main() {
    let mut gemla = Gemla::<MyNode>::new(
        &PathBuf::from("state.json"),
        GemlaConfig { overwrite: true },
        DataFormat::Json,
    ).await.unwrap();
    // Grows simulation tree by 5 levels
    gemla.simulate(5).await.unwrap();
}

Crate Organization

  • All core simulation logic is in core.
  • Tree structures and macros are in tree.
  • Error types and helpers are in error.

Getting Started

  1. Define your node type and implement the GeneticNode trait.
  2. Create a Gemla instance and run simulations.
  3. Use the provided error handling and tree utilities as needed.

Dependencies

~14–26MB
~364K SLoC