@@ -0,0 +1,1339 @@
+package org.sam.genetics;%0A%0Aimport org.sam.tree.INode;%0Aimport org.sam.tree.NodeFactory;%0Aimport org.sam.tree.TraverseVisitor;%0Aimport org.sam.tree.Tree;%0A%0Aimport javax.xml.soap.Node;%0Aimport java.util.Random;%0A%0A/**%0A * Provides evolutionary functionality:%0A * %3Cul%3E%0A *     %3Cli%3Ecross-over%3C/li%3E%0A *     %3Cli%3Emutation%3C/li%3E%0A * %3C/ul%3E%0A * Created by samuel on 05/08/14.%0A */%0Apublic class Evolution %7B%0A    private static final Random rand = new Random();%0A%0A    /**%0A     * Traverses each given tree, chooses a random node in each and swaps them%0A     * with their hole subtree.%0A     * @param lhs%0A     * @param rhs%0A     */%0A    public static void crossOver(Tree lhs, Tree rhs) %7B%0A        TraverseVisitor lhsVisitor = new TraverseVisitor(lhs);%0A        TraverseVisitor rhsVisitor = new TraverseVisitor(rhs);%0A%0A        INode lNode = lhsVisitor.getRandomNode();%0A        INode rNode = rhsVisitor.getRandomNode();%0A        INode tmp = rNode;%0A%0A        rNode = lNode;%0A        lNode = tmp;%0A    %7D%0A%0A    /**%0A     * Chooses a random node in the tree and creates a new one using a the %3Ccode%3ENodeFactory.getRandomNode()%3C/code%3E%0A     * method.%0A     * @param tree%0A     */%0A    public static void mutation(Tree tree) %7B%0A        TraverseVisitor treeVisitor = new TraverseVisitor(tree);%0A%0A        INode node = treeVisitor.getRandomNode();%0A%0A        node = NodeFactory.getRandomNode();%0A    %7D%0A%7D%0A

Add genetics functionality