I cannot speak to algorithms or performance. But you may want to force crossover in both trees. Probably what's going on right now is that your crossover operator is picking a single tree at random, then doing crossover in that tree. You could instead force both trees to get crossed over each time. The way I would do this is by having two crossover operators in your pipeline, one which feeds into the other. The first crossover operator would have its "tree" parameter fixed to tree 0, and the second crossover would have its "tree" parameter fixed to tree 1.
It's also possible that there's a bug, which you might want to double-check. Is the "same tree" always tree 0 or always tree 1? If not, it's unlikely to be a bug.
Also it seems to me you have two options:
1. Multiple trees (which you've done)
2. A single tree which returns multiple values
For the second case, you'd need GPNodes which return not one but two numbers -- just modify the GPData to have two instance variables as appropriate. This may or may not make sense for your problem.
On May 16, 2012, at 9:34 AM, Andreas Meier wrote:
> Hello there,
> Currently, I'm getting used to ECJ and it is really cool. I focus on
> symbolic regression and thus I've had a detailed look at tutorial 4, which
> tries to find a function that maps two input values to one output value.
> However, for my current task, I have two input values and two output values
> for which I would like to find a function via symbolic regression. How do I
> do that?
> I tried using two trees per individual which works sometimes well. Most
> often one of the trees seems to be stuck and doesn't evolve so that the best
> individuals of nearly all generations share a same tree. Do you have any
> idea why this happens? Since I'm using the default values (1024 individuals
> per generation, tournament size of 7), this seems unlikely to me.
> Thanks in advance!