public class OnePointCrossover extends java.lang.Object implements Variation
Constructor and Description |
---|
OnePointCrossover()
Constructs a one-point crossover operator with a 100% probability.
|
OnePointCrossover(double probability)
Constructs a one-point crossover operator with the specified probability
of applying this operator to solutions.
|
Modifier and Type | Method and Description |
---|---|
Solution[] |
evolve(Solution[] parents)
Evolves one or more parent solutions (specified by
getArity ) and produces one or more child solutions. |
int |
getArity()
Returns the number of solutions that must be supplied to the
evolve method. |
java.lang.String |
getName()
Returns the name of this variation operator.
|
double |
getProbability()
Returns the probability of applying this operator to solutions.
|
void |
setProbability(double probability)
Sets the probability of applying this operator to solutions.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyConfiguration, getConfiguration
public OnePointCrossover()
public OnePointCrossover(double probability)
probability
- the probability of applying this operator to solutionspublic java.lang.String getName()
Variation
public double getProbability()
public void setProbability(double probability)
probability
- the probability between 0.0 and 1.0, inclusivepublic Solution[] evolve(Solution[] parents)
Variation
getArity
) and produces one or more child solutions.
By contract, the parents must not be modified. The copy constructor should be used to create copies of the
parents with these copies subsequently modified.Copyright 2009-2024 David Hadka and other contributors. All rights reserved.
Licensed under the GNU Lesser General Public License.
Return to the MOEA Framework homepage.