|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.groovyj.jgprog.CrossMethod | +--com.groovyj.jgprog.BranchTypingCross
Constructor Summary | |
BranchTypingCross()
|
Method Summary | |
Individual[] |
cross(Individual i1,
Individual i2)
Crosses two individuals. |
protected static Chromosome[] |
doCross(Chromosome c0,
Chromosome c1)
Crosses two chromsomes using branch-typing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BranchTypingCross()
Method Detail |
public Individual[] cross(Individual i1, Individual i2)
cross
in class CrossMethod
i1
- the first individual to crossi2
- the second individual to crossprotected static Chromosome[] doCross(Chromosome c0, Chromosome c1)
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 crossc1
- the second chromosome to cross
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |