forked from markhobson/ai-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reformatted for Black Pepper code style
- Loading branch information
1 parent
9f8480d
commit 9d843f2
Showing
17 changed files
with
152 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package uk.co.blackpepper.neuroevolution; | ||
|
||
public interface Gene | ||
{ | ||
public interface Gene { | ||
Gene copy(); | ||
} |
13 changes: 5 additions & 8 deletions
13
src/main/java/uk/co/blackpepper/neuroevolution/GeneFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
package uk.co.blackpepper.neuroevolution; | ||
|
||
public class GeneFactory | ||
{ | ||
public class GeneFactory { | ||
private int innovation; | ||
|
||
public GeneFactory() | ||
{ | ||
public GeneFactory() { | ||
innovation = 1; | ||
} | ||
|
||
public ConnectionGene newConnectionGene(NodeGene input, NodeGene output, double weight) | ||
{ | ||
public ConnectionGene newConnectionGene(NodeGene input, NodeGene output, double weight) { | ||
return new ConnectionGene(input, output, weight, true, nextInnovation()); | ||
} | ||
|
||
private int nextInnovation() | ||
{ | ||
private int nextInnovation() { | ||
return innovation++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.