ECJ's vector individiuals have hooks and functional support for
variable-length genomes, but do not at present have breeding or
initialization operators. You'll have to write those: though it's not
very hard. Let's say you're making a variable-length subclass of
1. Override the defaultCrossover and defaultMutate methods to create
your own crossover and mutation operators. You can use the split and
join methods, and the setGenomeLength method if you like.
2. Override the reset method to create a totally randomized genotype.
This is called during initialization of the individual. A simple
approach is to create a new genome array, then call super.reset(...).
3. And that's probably it!
David F. Barrero wrote:
> Dear all,
> I am a new member to this list and ECJ. Now I need to implement a GA
> with a variable-length genoma to solve a problem very close to
> grammatical evolution and I'm a bit confused. Many documentation about
> ECJ state that it supports variable-length genoma, however there is not
> too much information about this topic.
> Googling and reading the documentation I only could find three
> references about variable-length genoma:
> As long as I understand, variable-length genoma is not directly
> supported by ECJ, instead it is necessary to implement my own
> individuals, initialization and breeding mechanisms using split() and
> join() methods. Could you, please, confirm this idea? Is it possible to
> provide any example implementing it?.
> I've been also evaluating the use of subpopulations with different
> genoma sizes to implement my GA. The idea is to use the exchange
> mechanism to "simulate" variations in the genoma size. It is not clear
> for me if it is a suitable solution and the theoretical and practical
> differences of this alternative compared with a variable-length genoma.
> Thanks in advance,