Skip to content

Commit

Permalink
Merge pull request #52 from inflectrix/dev
Browse files Browse the repository at this point in the history
genetic-rs 0.4.0
  • Loading branch information
HyperCodec committed Feb 27, 2024
2 parents 42ce397 + 8b82dd8 commit a1abf51
Show file tree
Hide file tree
Showing 18 changed files with 546 additions and 48 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: CI-CD

on: [push, pull_request]
on:
push:
branches: [main]
pull_request:

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/target/
**/target/
/.vscode/
72 changes: 63 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 3 additions & 35 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
[package]
name = "genetic-rs"
description = "A small crate for quickstarting genetic algorithm projects"
version = "0.3.0"
edition = "2021"
authors = ["Inflectrix"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/inflectrix/genetic-rs"
repository = "https://github.com/inflectrix/genetic-rs"
keywords = ["genetic", "algorithm", "rust"]
categories = ["algorithms", "science", "simulation"]

[features]
default = ["builtin", "genrand"]
builtin = []
crossover = ["builtin"]
speciation = ["crossover"]
genrand = []
rayon = ["dep:rayon"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
replace_with = "0.1.7"
rand = "0.8.5"
rayon = { version = "1.8.0", optional = true }

[[example]]
name = "crossover"
required-features = ["crossover"]

[[example]]
name = "speciation"
required-features = ["speciation"]
[workspace]
members = ["genetic-rs", "genetic-rs-common", "genetic-rs-macros"]
resolver = "2"
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
[<img alt="crates.io" src="https://img.shields.io/crates/d/genetic-rs" height="20">](https://crates.io/crates/genetic-rs)
[<img alt="docs.rs" src="https://img.shields.io/docsrs/genetic-rs" height="20">](https://docs.rs/genetic-rs)

A small crate for quickstarting genetic algorithm projects
A small crate for quickstarting genetic algorithm projects.

### How to Use
*note: if you are interested in implementing NEAT with this, try out the [neat](https://crates.io/crates/neat) crate*

### Features
First off, this crate comes with the `builtin` and `genrand` features by default. If you want to add the builtin crossover reproduction extension, you can do so by adding the `crossover` feature. If you want it to be parallelized, you can add the `rayon` feature. If you want your crossover to be speciated, you can add the `speciation` feature.
Expand Down Expand Up @@ -84,7 +85,7 @@ fn main() {
}
```

That is the minimal code for a working pruning-based genetic algorithm. You can [read the docs](https://docs.rs/genetic-rs) or [check the examples](/examples/) for more complicated systems.
That is the minimal code for a working pruning-based genetic algorithm. You can [read the docs](https://docs.rs/genetic-rs) or [check the examples](/genetic-rs/examples/) for more complicated systems.

### License
This project falls under the `MIT` license.
134 changes: 134 additions & 0 deletions genetic-rs-common/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions genetic-rs-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[package]
name = "genetic-rs-common"
description = "Commonly-used parts of genetic-rs"
version = "0.4.0"
edition = "2021"
authors = ["Inflectrix"]
license = "MIT"
readme = "../README.md"
homepage = "https://github.com/HyperCodec/genetic-rs"
repository = "https://github.com/HyperCodec/genetic-rs"
keywords = ["genetic", "algorithm", "rust"]
categories = ["algorithms", "science", "simulation"]

[features]
default = ["builtin", "genrand"]
builtin = []
crossover = ["builtin"]
speciation = ["crossover"]
genrand = []
rayon = ["dep:rayon"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.docs.rs]
features = ["crossover", "speciation"]
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
replace_with = "0.1.7"
rand = "0.8.5"
rayon = { version = "1.8.0", optional = true }

0 comments on commit a1abf51

Please sign in to comment.