Class HUXCrossover
java.lang.Object
org.uma.jmetal.operator.crossover.impl.HUXCrossover
- All Implemented Interfaces:
java.io.Serializable,CrossoverOperator<BinarySolution>,Operator<java.util.List<BinarySolution>,java.util.List<BinarySolution>>
public class HUXCrossover extends java.lang.Object implements CrossoverOperator<BinarySolution>
This class allows to apply a HUX crossover operator using two parent solutions. NOTE: the
operator is applied to the first encoding.variable of the solutions, and the type of the
solutions must be Binary
- Version:
- 1.0
- Author:
- Antonio J. Nebro, Juan J. Durillo
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description HUXCrossover(double crossoverProbability)ConstructorHUXCrossover(double crossoverProbability, RandomGenerator<java.lang.Double> randomGenerator)Constructor -
Method Summary
Modifier and Type Method Description java.util.List<BinarySolution>doCrossover(double probability, BinarySolution parent1, BinarySolution parent2)Perform the crossover operationjava.util.List<BinarySolution>execute(java.util.List<BinarySolution> parents)Execute() methoddoublegetCrossoverProbability()intgetNumberOfGeneratedChildren()intgetNumberOfRequiredParents()voidsetCrossoverProbability(double crossoverProbability)
-
Constructor Details
-
HUXCrossover
public HUXCrossover(double crossoverProbability)Constructor -
HUXCrossover
public HUXCrossover(double crossoverProbability, RandomGenerator<java.lang.Double> randomGenerator)Constructor
-
-
Method Details
-
getCrossoverProbability
public double getCrossoverProbability()- Specified by:
getCrossoverProbabilityin interfaceCrossoverOperator<BinarySolution>
-
setCrossoverProbability
public void setCrossoverProbability(double crossoverProbability) -
execute
Execute() method- Specified by:
executein interfaceOperator<java.util.List<BinarySolution>,java.util.List<BinarySolution>>- Parameters:
parents- The data to process
-
doCrossover
public java.util.List<BinarySolution> doCrossover(double probability, BinarySolution parent1, BinarySolution parent2) throws JMetalExceptionPerform the crossover operation- Parameters:
probability- Crossover setProbabilityparent1- The first parentparent2- The second parent- Returns:
- An array containing the two offspring
- Throws:
JMetalException
-
getNumberOfRequiredParents
public int getNumberOfRequiredParents()- Specified by:
getNumberOfRequiredParentsin interfaceCrossoverOperator<BinarySolution>
-
getNumberOfGeneratedChildren
public int getNumberOfGeneratedChildren()- Specified by:
getNumberOfGeneratedChildrenin interfaceCrossoverOperator<BinarySolution>
-