diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-06 21:58:53 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-04-06 21:58:53 +0100 |
commit | e6dd7711c7dad5e000445208eb5845801f4ccffc (patch) | |
tree | 1454bd20a8dd7069b1283184c42f4def6d5f7e6f /src/jcgp/backend/population | |
parent | c7969623b44f375e30fa3f15dcd7581609276a0f (diff) |
About to make big changes to the way fitness works, committing just in case
Diffstat (limited to 'src/jcgp/backend/population')
-rw-r--r-- | src/jcgp/backend/population/Chromosome.java | 2 | ||||
-rw-r--r-- | src/jcgp/backend/population/Node.java | 2 | ||||
-rw-r--r-- | src/jcgp/backend/population/Population.java | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/jcgp/backend/population/Chromosome.java b/src/jcgp/backend/population/Chromosome.java index c7493b9..d438375 100644 --- a/src/jcgp/backend/population/Chromosome.java +++ b/src/jcgp/backend/population/Chromosome.java @@ -2,8 +2,8 @@ package jcgp.backend.population; import java.util.ArrayList; -import jcgp.JCGP.Resources; import jcgp.backend.exceptions.ParameterMismatchException; +import jcgp.backend.resources.Resources; public class Chromosome { diff --git a/src/jcgp/backend/population/Node.java b/src/jcgp/backend/population/Node.java index f1d37a1..6960ded 100644 --- a/src/jcgp/backend/population/Node.java +++ b/src/jcgp/backend/population/Node.java @@ -37,7 +37,7 @@ public class Node extends Gene implements MutableElement, Connection { public void initialise(Function newFunction, Connection ... newConnections) throws InsufficientConnectionsException { function = newFunction; - if (newConnections.length == function.getArity()) { + if (newConnections.length == chromosome.getResources().getInt("arity")) { connections = newConnections; } else { throw new InsufficientConnectionsException(); diff --git a/src/jcgp/backend/population/Population.java b/src/jcgp/backend/population/Population.java index 7b62d27..d2e6058 100644 --- a/src/jcgp/backend/population/Population.java +++ b/src/jcgp/backend/population/Population.java @@ -1,7 +1,6 @@ package jcgp.backend.population; -import jcgp.JCGP.Resources; - +import jcgp.backend.resources.Resources; public class Population { @@ -56,7 +55,6 @@ public class Population { return chromosomes[resources.getRandomInt(chromosomes.length)]; } - /** * Copy a chromosome into a different position. * After this returns, the target chromosome has @@ -75,4 +73,6 @@ public class Population { } + + } |