Print

Print


Hello,

I've recently started using ECJ and MASON to create a neuroevolution
program and I really appreciate the work put into both.  However, when
doing some debugging I attempted to read in an individual for a
subpopulation and encountered a few problems:

1) When Subpopulation.setup() first creates the array of individuals
each individual is null.  This isn't a problem when creating new
individuals, but when reading on line 270
Subpopulation.readSubpopulation() first checks to see if the individual
in the individual array is null which it's always going to be.  So
instead of reading in the individual it will always create new
individuals.  It appears that this check was done to avoid an invalid
element error since readIndividual() is an instance function.  A dummy
individual seems like the easiest way to fix this issue.

2) Even after this fix though there is still a problem if the individual
has a custom printIndividual() method (for instance, if the class is a
child of Individual with additional information that is printed and
needs to be read in).  It would be necessary then to create a dummy
individual that is the same type of individual specified in the subpop's
species before calling readIndividual() on it.

3) Tutorial 3 should be updated to reflect the changes to
printSubpopulation() and readSubpopulation() that include the number of
individuals and individual index preambles.

I believe for my purposes that I'll simply create a child of
Subpopulation to correct the above issues.  However, I wanted to bring
it to your attention for future releases or if I've missed something and
I'm not doing something correctly.

Thank you,

Myron Tuttle