- public class BranchTypingCross
- extends CrossMethod
|Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Individual cross(Individual i1,
- Crosses two individuals. A random chromosome is chosen for crossing based
probabilistically on the proportion of nodes in each chromosome in the first
cross in class
i1 - the first individual to cross
i2 - the second individual to cross
- an array of the two resulting individuals
protected static Chromosome doCross(Chromosome c0,
- Crosses two chromsomes using branch-typing.
A random point in the first chromosome is chosen,
with 90% probability it will be a function and 10% probability it will be
a terminal. A random point in the second chromosome
is chosen using the same
probability distribution, but the node chosen must be of the same type as the chosen node
in the first chromosome.
If a suitable point in the second chromosome couldn't be found then the
chromosomes are not crossed.
If a resulting chromosome's depth is larger than the given maximum depth
then that chromosome is simply copied from the original rather than crossed.
c0 - the first chromosome to cross
c1 - the second chromosome to cross
- an array of the two resulting chromosomes