innoave / genevo Goto Github PK
View Code? Open in Web Editor NEWExecute genetic algorithm (GA) simulations in a customizable and extensible way.
License: Other
Execute genetic algorithm (GA) simulations in a customizable and extensible way.
License: Other
in order to complete the basic encoding types of genes - see issue #2 - a genotype implementation for tree encoding shall be added.
In order to make using genevo more comfortable a 'prelude' module that reexports most common imports would be helpful.
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:
the implementation will be split up into 2 parts. with this feature request only the first 3 encoding types:
will be implemented. For tree encoding a separate issue will be created.
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
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)
# 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?
I wrote a traveling salesman problem in rust and build it with wasm bindgen.
demo https://warycat.github.io/ga_wasm/
src https://github.com/warycat/ga_wasm
Thank you for making this awesome crate.
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)?
Default crossover operators for basic encoding types are helpful to use the library for simulations with basic genotypes.
With this issue crossover operators for the following 3 encoding types will be supported:
In order to implement heavily parallel computation for GA simulations the support of subpopulations would be handy.
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.
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.
Rehashing - #24
We need single threaded execution. Can you guide us toward an implementation for this?
to speed up simulations parallel computation on multi core processors should be supported.
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.
I'm no biologist, but reading definitions, should structs/traits/fns with GenomeBuilder be rather called GenotypeBuilder? Also Evaluated::genome
should be a genotype?
Default mutation operators for basic encoding types are helpful to use the library for simulations with basic genotypes.
With this issue mutation operators for the following 3 encoding types will be supported:
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.