diff options
author | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-06 14:29:37 +0100 |
---|---|---|
committer | Eduardo Pedroni <ep625@york.ac.uk> | 2014-05-06 14:29:37 +0100 |
commit | 8189116ea4b5db4675e31dfd04a5687d55e29262 (patch) | |
tree | c1815021452a888f8838f1628d8fb4689777e73e /src/jcgp/backend/population/Chromosome.java | |
parent | aa9e74e7f67789f6353fc26e02ee8e68e40609a2 (diff) |
Added javadocs, made minor changes to the comments
Diffstat (limited to 'src/jcgp/backend/population/Chromosome.java')
-rw-r--r-- | src/jcgp/backend/population/Chromosome.java | 7 |
1 files changed, 5 insertions, 2 deletions
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<Chromosome> { * 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. * <br> * 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<Chromosome> { 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<Chromosome> { * 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 |