Coder Social home page Coder Social logo

innoave / genevo Goto Github PK

View Code? Open in Web Editor NEW
162.0 162.0 27.0 316 KB

Execute genetic algorithm (GA) simulations in a customizable and extensible way.

License: Other

Rust 99.92% Batchfile 0.08%
evolutionary-algorithms framework genetic-algorithm library optimization-algorithms rust search-algorithms

genevo's People

Contributors

dariogoetz avatar haraldmaida avatar ybyygu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

genevo's Issues

Add default types for binary encoding, value encoding and permutation encoding

Without knowing anything about the encoding of gene it is impossible to provide default implementations for crossover and mutation operator. Therefore it would make sense to implement the basic types of gene encodings, which are:

  • binary encoding
  • value encoding
  • permutation encoding
  • tree encoding

the implementation will be split up into 2 parts. with this feature request only the first 3 encoding types:

  • binary encoding
  • value encoding
  • permutation encoding

will be implemented. For tree encoding a separate issue will be created.

Advertise features in README

Hi,
I'm doing my first experiments in the field of GAs. After looking at all crates matching "genetic", genevo looked to me as the most promising library. Great work!
For others doing the same evaluation, a list of features in the README would help a lot. And for a beginner like me, more documentation would be immensely helpful. Ideal would be an exerpt of OBI98 with included code examples. Maybe you would get the permission for copying parts of it (see FAQ)?
But anyway, this issue is mostly to thank you for your work!
Gruss, Pirmin

Getting the current population after calling step()?

Quick question, is it possible to get the current population after calling Simulator::step()?

It seems step() returns an EvaluatedPopulation, which you can query using EvaluatedPopulation::individuals(), but this is the population before applying selection. I want to get the population after applying selection (so after selecting the best parents and cross-breeding them). Is this possible at all?

(Basically I'm looking for a way to access GeneticAlgorithm.population directly, which is not possible at the moment since it's private)

Are combinators not composable or combineable?

# rust toolchain version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.73.0 (cc66ad468 2023-10-03)`

# genevo version from our Cargo.toml
genevo = "0.7.1"

Our simulation setup:

        let mut cvr_sim = simulate(
            genetic_algorithm()
                .with_evaluation(...)
                .with_selection(MaximizeSelector::new(
                    selection_ratio,
                    num_individuals_per_parents,
                ))
                .with_crossover(MultiPointCrossBreeder::new(self.num_crossover_points))
                .with_mutation(RandomValueMutator::new(
                   mutation_rate,
                    mutation_min,
                    mutation_max,
                ))
                .with_reinsertion(ElitistReinserter::new(
                    ...,
                    true,
                    elitism_ratio,
                ))
                .with_initial_population(initial_population)
                .build(),
        )
        .until(or(
            or(
                FitnessLimit::new(highest_possible_fitness()),
                GenerationLimit::new(generation_limit),
            ),
            and(
                FitnessLimit::new(lowest_possible_fitness()),
                GenerationLimit::new(3),
            ),
        ))
        .build();

Specifically referring to the section using or and and inside the until(...). Basically the "sub-OR" was originally the only combinator. We have a section of code where we are using FFI to call into some shared object files to solve complex circuit models (OpenDSS). Inside our fitness function implementation is where we are setting up, exercising, and solving the circuit via the FFI and evaluating the fitness score of the calculations.

Due to this legacy-style setup, I was hoping to use the example I provided here to do either the original combinator (like what's shown in some of the examples), OR if we return the worst possible fitness score AND have 3 generations, then the algorithm simulation would know to stop. FWIW in all of the simulation runs we've done, we have never gotten closer than 90 points to the worst possible score.

Am I misunderstanding or using this incorrectly?

Question: Lamarckian evolution

Will genevo work correctly if the Genotype has interior mutability and updates itself while being evaluated, and the updates are intended to be heritable (i.e. Lamarckian rather than Darwinian evolution)?

Processing time is not meassured correctly

Since execution of crossover and mutation is done in parallel, the processing time is no longer correct.
The processing time should be meassured in each thread separately.

How to use `f32` / `f64` as fitness scores?

Hello,

I am currently stuck using a janky float discretization technique because I can't use floats directly.

Is there a better workaround? Is there some truly compelling reason we cannot implement the Fitness trait for floats internally like is done for the signed and unsigned integers?

Thank you.

Disable GA parallelism

I'm currently implementing a genetic algorithm that runs a circuit simulation to evaluate a circuits fitness. To perform the simulation, I use a third party C API. This API is called from within the fitness_of() function of the FitnessFunction trait I defined.

The third party C API I use cannot be used in a multi-threaded fashion. so I'm wondering if it's possible to disable the parallelism in the ga module; or if there is a less performant, sequential version of genevo.

GenomeBuilder -> GenotypeBuilder?

I'm no biologist, but reading definitions, should structs/traits/fns with GenomeBuilder be rather called GenotypeBuilder? Also Evaluated::genome should be a genotype?

Future compile error on Rust beta 1.60 in `types/tests.rs`

A crater run found that this crate's tests no longer compile with rust 1.60 beta (see rust-lang/rust#94504) due to a newly added method causing conflicts in method resolution.

The regression has been deemed an acceptable minor change per RFC 1105.
It can be fixed by using fully qualified function call syntax to unambiguously call the extension trait that previously provided abs_diff or by switching to the new std API once 1.60 is released.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.