note
kvale
For a tree represented as a recursive hash, the crossover and mutation operators are fairly simple.
<p>
It looks like you have only binomial operators, so a binary tree. To arrive at a random node, start at the root, $tree, and pick a random key, "left" or right". Then ,e.g., $tree->{left} becomes the new root and pick another random key, etc. Continue walking the hash until you get to a terminal, which you can recognize as a non-reference.
Alter that terminal to get a one-point mutation.
<p>
For a crossover, each node on the tree is a ref, so you can just exchange references:
<code>
$temp = $tree->{right}{left};
$tree->{right}{left} = $tree->{right}{right};
$tree->{right}{right} = temp;
</code>
For Boolean expression chromosomes, you will want to make sure that mutations and crossovers generate a syntatctically valid expression (I haven't checked your code for this).
<p>
That is the general idea. The implementation is left as an exercise :)
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-145001">
<p>
-Mark
</div></div>
398370
398370