rsgenetic
Library Archived
A library providing genetic algorithm execution.
- Downloads
- 56
- Dependents
- 0
- Stars
- 77
- Forks
- 19
- Contributors
- 7
- Commits
- 198
- Latest release
- 1.8.1 ·
Why Archived
GitHub reports the repository as archived.
Exact rules: Instant archive. The check on applied thresholds version 9.
Every rule outcome, as the check records it
instant-archive: repository is archived
About
Summary and Features
RsGenetic is a framework for executing genetic algorithms in Rust. It is designed to have a simple but modular API.
Examples and Documentation
Documentation is available here.
Implementing the Fitness trait
Note that, if your fitness type is an integer type, you
do not need to write a wrapper struct around this integer. See
the types module documentation for more details.
use rsgenetic::pheno::*;
use std::cmp::Ordering;
#[derive(Eq, PartialEq, PartialOrd, Ord)]
struct MyFitness {
value: i32,
}
impl Fitness for MyFitness {
// The zero value for our custom type
fn zero() -> MyFitness {
MyFitness { value: 0 }
}
// The absolute difference between two instances
fn abs_diff(&self, other: &MyFitness) -> MyFitness {
MyFitness {
value: (self.value - other.value).abs()
}
}
}
Implementing the Phenotype trait
Note that we use an integer type as the fitness type parameter to make this example more simple. Replace it with your custom type if needed. In this example, we try to find individuals with two integer components that sum to a target value.
Read the full README
This example is far-fetched, but simplified to show how
easy it is to define new individuals and implement
the Phenotype trait.
use rsgenetic::pheno::*;
const TARGET: i32 = 100;
#[derive(Copy, Clone)]
struct MyPheno {
x: i32,
y: i32,
}
impl Phenotype<i32> for MyPheno {
// How fit is this individual?
fn fitness(&self) -> i32 {
TARGET - (self.x + self.y)
}
// Have two individuals create a new individual
fn crossover(&self, other: &MyPheno) -> MyPheno {
MyPheno {
x: self.x,
y: other.y,
}
}
// Mutate an individual, changing its state
fn mutate(&self) -> MyPheno {
MyPheno {
x: self.x + 1,
y: self.y - 1,
}
}
}
Creating and running a Simulator
use rsgenetic::pheno::*;
use rsgenetic::sim::*;
use rsgenetic::sim::seq::Simulator;
use rsgenetic::sim::select::*;
const TARGET: i32 = 100;
#[derive(Copy, Clone)]
struct MyPheno {
x: i32,
y: i32,
}
impl Phenotype<i32> for MyPheno {
// How fit is this individual?
fn fitness(&self) -> i32 {
TARGET - (self.x + self.y)
}
// Have two individuals create a new individual
fn crossover(&self, other: &MyPheno) -> MyPheno {
MyPheno {
x: self.x,
y: other.y,
}
}
// Mutate an individual, changing its state
fn mutate(&self) -> MyPheno {
MyPheno {
x: self.x + 1,
y: self.y - 1,
}
}
}
fn main() {
let mut population = (0..100).map(|i| MyPheno { x: i, y: 100 - i }).collect();
let mut s = Simulator::builder(&mut population)
.set_selector(Box::new(StochasticSelector::new(10)))
.set_max_iters(50)
.build();
s.run();
let result = s.get().unwrap(); // The best individual
}
See the examples directory in the repository for more elaborate examples.
Note
This library is currently in maintenance mode. There have been some indications that the API needs an update to be more flexible, which would require an incrementation of the major version number (#23, #30). Unfortunately, I currently do not have the time to implement such a redesign. I will however continue to reply to issues and merge pull requests, but features might not be implemented by me, depending on their size.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Contributions are always welcome. Take a look at the issues for any enhancements that need to be done or bugs that need to be fixed. If you encounter any bugs while using the library, feel free to open an issue and/or fix the bug, and submit pull requests.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- Apache-2.0 OR MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
A library providing genetic algorithm execution. |
56 downloads over 30 days | 0 | 77 | 1.8.1 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
leiden-rs Listed
High-performance Leiden community detection algorithm for graphs in Rust |
41,983 downloads over 30 days | 10 | Not measured | 0.8.1 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
radiate Listed
A Rust library for genetic algorithms and artificial evolution. Python bindings |
971 downloads over 30 days | 0 | 257 | 1.3.2 | GPU support unknown | No native code found | MIT |
|
genevo provides building blocks to run simulations of optimization and search problems using genetic algorithms (GA). Execute genetic algorithm (GA) simulations in a customizable and extensible way. |
372 downloads over 30 days | 1 | 185 | 0.7.1 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
Fast, parallel, extensible and adaptable genetic algorithm library. |
89 downloads over 30 days | 0 | 183 | 2.2.2 | GPU support unknown | No native code found | MPL-2.0 |
|
treeboost Listed
Gradient-boosted decision trees for tabular data: trains a baseline model in one call, with full control over boosting modes and configs, and Scalar, AVX-512, SVE2, WGPU and CUDA backends. Python bindings |
18 downloads over 30 days | 0 | 9 | 0.1.2 | CUDA, WebGPU | No native code found | Apache-2.0 |
|
Rust implementation of real-coded genetic algorithm for solving optimization problems and training of neural networks. The latter is also known as neuroevolution. |
9 downloads over 30 days | 0 | 20 | 0.2.1 | GPU support unknown | No native code found | GPL-3.0 |
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 5 years ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2021-01-22 | GitHub repository | Yes | |
| Latest release | 2021-01-21 | crates.io database dump | Yes | |
| First release | 2015-12-12 | crates.io database dump | Yes | |
| Latest version | 1.8.1 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 0 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | true | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution52 releases, 56 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 52 | crates.io database dump | Yes | |
| Downloads over 30 days | 56 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository77 stars, 19 forks, 7 contributors, 198 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 77 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 19 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 7 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 198 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 OR MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 0 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.