Print

Print


Hello all,

I am curious about the reasoning behind having multiple GP trees under one
GP individual. In the code, GPIndividual is defined as:

public class GPIndividual extends Individual
    {
    ...
    public GPTree[] trees;
    ...
}

1.
It seems the tutorials normally have one tree under one individual. I
wonder what are the usages of having multiple trees under one individual.
I read the code in ec.gp.koza.CrossoverPipeline, it seems that when one
individual has multiple trees, one tree is selected randomly for the
crossover. I understand this can be customized to a different version. For
example, tree1 of individual A can only be crossed with tree1 of individual
B.

2.
Additionally, if we have multiple trees under one individual, do we need to
change the parameter file so the crossover happen normally? (To me the
answer is no, but I am not sure.) Say if I use the following as my
parameter when there is only one tree under one individual:

pop.subpop.0.species.pipe = ec.breed.MultiBreedingPipeline
# Koza's decision here was odd...
pop.subpop.0.species.pipe.generate-max = false
# Subsidiary pipelines:
pop.subpop.0.species.pipe.num-sources = 2
pop.subpop.0.species.pipe.source.0 = ec.gp.koza.CrossoverPipeline
pop.subpop.0.species.pipe.source.0.prob = 0.9
pop.subpop.0.species.pipe.source.1 = ec.breed.ReproductionPipeline
pop.subpop.0.species.pipe.source.1.prob = 0.1

Thank you very much!

Ye Xiaomeng