es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover
Class RandomCrossOver
java.lang.Object
es.udc.gii.common.eaf.algorithm.operator.reproduction.ReproductionOperator
es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover.CrossOverOperator
es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover.RandomCrossOver
- All Implemented Interfaces:
- Operator, Configurable
public class RandomCrossOver
- extends CrossOverOperator
Random Crossover is a fairly simple crossover operator. Basically, the operator choose n
random points in the chromosomes of the individuals and generate two new individuals by exchanging
the genes between the individuals about this n points.
To config this operator the xml code is:
<Operator>
<Class>es.udc.gii.common.eaf.algorithm.operator.reproduction.crossover.RandomCrossOver</Class>
<Probability>value</Probability>
</Operator>
Where probability is a double value in the range [0, 100] which represents the probability of crossover.
If this does not appear in the configuration, the parameter is set to the default values.
Default values:
- Probability is set to 60.0
- Since:
- 1.0
- Author:
- Grupo Integrado de IngenierĂa (www.gii.udc.es)
Field Summary |
private int |
points
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
points
private int points
RandomCrossOver
public RandomCrossOver()
RandomCrossOver
public RandomCrossOver(int probability,
int points)
configure
public void configure(org.apache.commons.configuration.Configuration conf)
- Description copied from interface:
Configurable
- Configures the specific element that implements this method.
- Specified by:
configure
in interface Configurable
- Overrides:
configure
in class CrossOverOperator
- Parameters:
conf
- a Configuration object.- See Also:
Configuration
crossOver
protected java.util.List<Individual> crossOver(EvolutionaryAlgorithm ea,
java.util.List<Individual> individuals)
- Specified by:
crossOver
in class CrossOverOperator