Print

Print


I came into the ECJ project recently.  I have the experience of developing
independently a Genetic Algorithm framework prior to joining ECJ.   ECJ
has several good designs that I did not have.   I also see that ECJ could
benefit from some of the design decisions I used.   Which shows that two
heads are always better than one.

Instead of spreading the creation of Individual(s) across several classes
like SubPopulation, Species, Individual..etc, I think it would be better
to use the classic Class Factory Pattern.   That is, have a factory class
for the Individual called IndividualFactory which is solely responsible
for creating a specific type of Individual (including cloning..etc).
Make both Individual and IndividualFactory an interface and specialize to
need.   I used this same pattern in the same circumstance and it makes
everything much easier.

This factory would know how to clone, have a copy of Fitness to clone
from,..etc.   I think such change would greatly simplify several other
classes like SubPopulation which will become almost empty and could just
become and embedded class of Population (another suggestion).   Several
other simplifications would flow from that.

CP