From e6dd7711c7dad5e000445208eb5845801f4ccffc Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Sun, 6 Apr 2014 21:58:53 +0100 Subject: About to make big changes to the way fitness works, committing just in case --- src/jcgp/backend/population/Chromosome.java | 2 +- src/jcgp/backend/population/Node.java | 2 +- src/jcgp/backend/population/Population.java | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/jcgp/backend/population') 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 { } + + } -- cgit v1.2.3