This is quite trivial to achieve. The simplest way to do this could be to tailor your 'inittree' method. Where the inittree generates a random tree, you may do some hard coding to produce the desired tree. Another way could be to write a function that performs this functionality when provided with the desired inputs. U may eventually keep it in the function set, and may as well initialize every tree to have this 'single-node' structure.
The problem with the second approach would be that any make/break to the individuals during evolution would be around this tree and not 'on' it.
The way you are trying to do evolution has an obvious drawback; your population would suffer from a serious lack of
diversity (zero diversity). So, for instance, crossover wouldnt have any effect in the beginning. You will also suffer from a problem of premature convergence. Thus if your function represents a non-optimum solution then it will hard for GP to jump out of it to find a better one. Remember, evolution depends a great deal on program diversity.
Then if you want to have the whole population to be this, then you may
----- Original Message ----
From: Shane <[log in to unmask]
To: [log in to unmask]
Sent: Friday, April 25, 2008 7:22:55 PM
Subject: Initialize trees
In gp, is there a way to start every individual out with the same tree instead of a random tree, and then start evolving from there.
For example: say I want every individual to start out looking like this:
(if (> x y) dothis)
and then evolve from that starting point instead of every individual being completely random. I am trying to evolve an existing solution into a better solution.