Skip to content

Commit

Permalink
Crosspoints cannot be 0, which generates children identical to parents
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin1887 committed Jan 6, 2019
1 parent de38898 commit a94e5a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In your `Cargo.toml` file add the `oxigen` dependency:

```
[dependencies]
oxigen = "1.1"
oxigen = "^1.4.1"
```

To use `oxigen` `use oxigen::prelude::*` and call the `run` method over a `GeneticExecution` instance overwriting the default hyperparameters and functions folllowing your needs:
Expand Down
2 changes: 1 addition & 1 deletion oxigen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oxigen"
version = "1.4.0"
version = "1.4.1"
authors = ["Martin1887 <marcos.martin.pozo.delgado@gmail.com>"]
description = "Fast and parallel genetic algorithm library."
repository = "https://github.com/Martin1887/oxigen"
Expand Down
2 changes: 1 addition & 1 deletion oxigen/src/crossover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl<T, G: Genotype<T>> Crossover<T, G> for CrossoverFunctions {
match self {
SingleCrossPoint => {
let ind_size = min(ind1.iter().len(), ind2.iter().len());
let cross_point = SmallRng::from_entropy().sample(Uniform::from(0..ind_size));
let cross_point = SmallRng::from_entropy().sample(Uniform::from(1..ind_size));

(
ind1.clone()
Expand Down

0 comments on commit a94e5a7

Please sign in to comment.