Skip to content

Commit e19e610

Browse files
authored
Merge pull request #92 from HyperCodec/dev
Update v0.6.0
2 parents 72ef31f + 3345992 commit e19e610

File tree

14 files changed

+415
-109
lines changed

14 files changed

+415
-109
lines changed

Cargo.lock

Lines changed: 151 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = ["genetic-rs", "genetic-rs-common", "genetic-rs-macros"]
33
resolver = "2"
44

55
[workspace.package]
6-
version = "0.5.4"
6+
version = "0.6.0"
77
authors = ["HyperCodec"]
88
homepage = "https://github.com/hypercodec/genetic-rs"
99
repository = "https://github.com/hypercodec/genetic-rs"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ struct MyGenome {
2222

2323
// required in all of the builtin functions as requirements of `DivsionReproduction` and `CrossoverReproduction`
2424
impl RandomlyMutable for MyGenome {
25-
fn mutate(&mut self, rate: f32, rng: &mut impl rand::Rng) {
25+
fn mutate(&mut self, rate: f32, rng: &mut impl Rng) {
2626
self.field1 += rng.gen::<f32>() * rate;
2727
}
2828
}
2929

3030
// required for `division_pruning_nextgen`.
3131
impl DivsionReproduction for MyGenome {
32-
fn divide(&self, rng: &mut impl rand::Rng) -> Self {
32+
fn divide(&self, rng: &mut impl ng) -> Self {
3333
let mut child = self.clone();
3434
child.mutate(0.25, rng); // use a constant mutation rate when spawning children in pruning algorithms.
3535
child
@@ -44,7 +44,7 @@ impl Prunable for MyGenome {
4444
}
4545
}
4646

47-
// helper trait that allows us to use `Vec::gen_random` for the initial population.
47+
// allows us to use `Vec::gen_random` for the initial population.
4848
impl GenerateRandom for MyGenome {
4949
fn gen_random(rng: &mut impl rand::Rng) -> Self {
5050
Self { field1: rng.gen() }
@@ -66,11 +66,11 @@ Once you have your reward function, you can create a `GeneticSim` object to mana
6666

6767
```rust
6868
fn main() {
69-
let mut rng = rand::thread_rng();
69+
let mut rng = rand::rng();
7070
let mut sim = GeneticSim::new(
7171
// you must provide a random starting population.
7272
// size will be preserved in builtin nextgen fns, but it is not required to keep a constant size if you were to build your own nextgen function.
73-
// in this case, you do not need to specify a type for `Vec::gen_random` because of the input of `my_fitness_fn`.
73+
// in this case, the compiler can infer the type of `Vec::gen_random` because of the input of `my_fitness_fn`.
7474
Vec::gen_random(&mut rng, 100),
7575
my_fitness_fn,
7676
division_pruning_nextgen,

genetic-rs-common/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ crossover = ["builtin"]
1818
speciation = ["crossover"]
1919
genrand = []
2020
rayon = ["dep:rayon"]
21+
tracing = ["dep:tracing"]
2122

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

@@ -27,5 +28,6 @@ rustdoc-args = ["--cfg", "docsrs"]
2728

2829
[dependencies]
2930
replace_with = "0.1.7"
30-
rand = "0.8.5"
31-
rayon = { version = "1.8.0", optional = true }
31+
rand = "0.9.0"
32+
rayon = { version = "1.10.0", optional = true }
33+
tracing = { version = "0.1.41", optional = true }

0 commit comments

Comments
 (0)