public class SingleNodeCrossover<G extends TreeGene<?,G>,C extends Comparable<? super C>> extends TreeCrossover<G,C>
Tree A Tree B
0 a
├── 1 ├── b
│ ├── 4 │ ├── e
│ └── 5 │ └── f
├── 2 ├── c
│ └── 6 │ └── g
└── 3 └── d
├── 7 ├── h
│ ├── 10 │ ├── k
│ └── 11 │ └── l
├── 8 ├── i
└── 9 └── j
Swap node "3" of A with node "c" of B
0 a
├── 1 ├── b
│ ├── 4 │ ├── e
│ └── 5 │ └── f
├── 2 ├── 3
│ └── 6 │ ├── 7
└── c │ │ ├── 10
└── g │ │ └── 11
│ ├── 8
│ └── 9
└── d
├── h
│ ├── k
│ └── l
├── i
└── j
_probability
DEFAULT_ALTER_PROBABILITY
Constructor and Description |
---|
SingleNodeCrossover() |
SingleNodeCrossover(double probability) |
Modifier and Type | Method and Description |
---|---|
protected <A> int |
crossover(TreeNode<A> that,
TreeNode<A> other)
Template method which performs the crossover.
|
String |
toString() |
recombine
alter, getOrder
getProbability
public SingleNodeCrossover(double probability)
public SingleNodeCrossover()
protected <A> int crossover(TreeNode<A> that, TreeNode<A> other)
TreeCrossover
crossover
in class TreeCrossover<G extends TreeGene<?,G>,C extends Comparable<? super C>>
A
- the existential allele typethat
- the first (chromosome) treeother
- he second (chromosome) tree© 2007-2019 Franz Wilhelmstötter (2019-11-18 20:30)