From 8189116ea4b5db4675e31dfd04a5687d55e29262 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Tue, 6 May 2014 14:29:37 +0100 Subject: Added javadocs, made minor changes to the comments --- src/jcgp/backend/population/Chromosome.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/jcgp/backend/population/Chromosome.java') diff --git a/src/jcgp/backend/population/Chromosome.java b/src/jcgp/backend/population/Chromosome.java index b99b817..0dfa801 100644 --- a/src/jcgp/backend/population/Chromosome.java +++ b/src/jcgp/backend/population/Chromosome.java @@ -159,7 +159,8 @@ public class Chromosome implements Comparable { * this instance. In practice, this iterates through the * entire chromosome making equivalent connections and * setting functions to the same values as those in the - * specified chromosome. + * specified chromosome. It also sets the fitness of the + * copy to the same value as the original. *
* It is assumed that both chromosomes have the same * topology; while this method will still run if that is not @@ -205,6 +206,9 @@ public class Chromosome implements Comparable { System.out.println("Warning: Connection of subtype " + copyOutput.getClass().toString() + " is not explicitly handled by copy constructor."); } } + + // copy fitness as well + this.fitness = clone.getFitness(); } /** @@ -264,7 +268,6 @@ public class Chromosome implements Comparable { * number of inputs exactly, an exception is thrown. * * @param values the values the input should take. - * @throws ParameterMismatchException if the wrong number of values is received. */ public void setInputs(Object ... values) { // if the values provided don't match the specified number of inputs, the user should be warned -- cgit v1.2.3