Skip to content

Commit

Permalink
further bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed Mar 11, 2020
1 parent 2a1d435 commit 46e8cc3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ First, you need to add the following repository, which is a repository that can
```

Than you can add the dependency on our `aitoa-code` repository into your `dependencies` section.
Here, `0.8.41` is the current version of `aitoa-code`.
Here, `0.8.42` is the current version of `aitoa-code`.
Notice that you may have more dependencies in your `dependencies` section, say on `junit`, but here I just put the one for `aitoa-code` as example.

```xml
<dependencies>
<dependency>
<groupId>com.github.thomasWeise</groupId>
<artifactId>aitoa-code</artifactId>
<version>0.8.41</version>
<version>0.8.42</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>aitoa</groupId>
<artifactId>aitoa-code</artifactId>
<version>0.8.41</version>
<version>0.8.42</version>
<packaging>jar</packaging>
<name>aitoa-code</name>
<description>Example Source Codes from the Book "Introduction to Optimization Algorithms"</description>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/aitoa/algorithms/EA.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ public final void solve(final IBlackBoxProcess<X, Y> process) {
}

final Individual<X> dest = P[index];
final Individual<X> sel = P[(++p1) % this.mu];
p1 = (p1 + 1) % this.mu;
final Individual<X> sel = P[p1];
// end relevant
// start withcrossover
if (random.nextDouble() <= this.cr) { // crossover!
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/aitoa/algorithms/EAWithFitness.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public final void solve(final IBlackBoxProcess<X, Y> process) {
}

final FitnessIndividual<X> dest = P[index];
final FitnessIndividual<X> sel = P[(++p1) % this.mu];
p1 = (p1 + 1) % this.mu;
final FitnessIndividual<X> sel = P[p1];
if (random.nextDouble() <= this.cr) { // crossover!
int p2; // to hold index of second selected record
do { // find a second, different record
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/aitoa/algorithms/EAWithRestarts.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ public final void solve(final IBlackBoxProcess<X, Y> process) {
}

final Individual<X> dest = population[index];
final Individual<X> parent1 =
population[(++p1) % this.mu]; // parent 1
p1 = (p1 + 1) % this.mu;
final Individual<X> parent1 = population[p1]; // parent
// 1

if (random.nextDouble() <= this.cr) { // crossover!
int p2;
Expand Down

0 comments on commit 46e8cc3

Please sign in to comment.