|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jgap.impl.CrossoverOperator
The crossover operator randomly selects two Chromosomes from the population and "mates" them by randomly picking a gene and then swapping that gene and all subsequent genes between the two Chromosomes. The two modified Chromosomes are then added to the list of candidate Chromosomes. This CrossoverOperator supports both fixed and dynamic crossover rates. A fixed rate is one specified at construction time by the user. This operation is performed 1/m_crossoverRate as many times as there are Chromosomes in the population. A dynamic rate is one determined by this class if no fixed rate is provided.
| Constructor Summary | |
CrossoverOperator()
Constructs a new instance of this CrossoverOperator without a specified crossover rate, this results in dynamic crossover rate being turned off. |
|
CrossoverOperator(int a_desiredCrossoverRate)
Constructs a new instance of this CrossoverOperator with the given crossover rate. |
|
CrossoverOperator(IUniversalRateCalculator a_crossoverRateCalculator)
Constructs a new instance of this CrossoverOperator with a specified crossover rate calculator, which results in dynamic crossover being turned on. |
|
| Method Summary | |
void |
operate(Population a_population,
java.util.List a_candidateChromosomes)
The operate method will be invoked on each of the genetic operators referenced by the current Configuration object during the evolution phase. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CrossoverOperator()
public CrossoverOperator(IUniversalRateCalculator a_crossoverRateCalculator)
a_crossoverRateCalculator - calculator for dynamic crossover rate
computationpublic CrossoverOperator(int a_desiredCrossoverRate)
a_desiredCrossoverRate - The desired rate of crossover.| Method Detail |
public void operate(Population a_population,
java.util.List a_candidateChromosomes)
operate in interface GeneticOperatora_population - The population of chromosomes from the current
evolution prior to exposure to any genetic operators.
Chromosomes in this array should never be modified.a_candidateChromosomes - The pool of chromosomes that are candidates
for the next evolved population. Only these
chromosomes will go to the natural
phase, so it's important to add any
modified copies of Chromosomes to this
list if it's desired for them to be
considered for natural selection.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||