Package edu.cnu.mdi.sim.ga.triimage
Class UniformBlendCrossover
java.lang.Object
edu.cnu.mdi.sim.ga.triimage.UniformBlendCrossover
- All Implemented Interfaces:
CrossoverOperator<PolygonChromosome>
public final class UniformBlendCrossover
extends Object
implements CrossoverOperator<PolygonChromosome>
Uniform crossover that treats each encoded triangle as an indivisible building
block. All ten genes for a child triangle come from the same parent, preserving
useful combinations of geometry, color, and opacity. Two complementary
children are returned: whenever the first receives a triangle from one parent,
the second receives the corresponding triangle from the other. This retains
more population diversity than discarding half of each mating's genetic material.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncrossover(PolygonChromosome p1, PolygonChromosome p2, Random rng) Combine two parents into one or more new children.
-
Constructor Details
-
UniformBlendCrossover
public UniformBlendCrossover()
-
-
Method Details
-
crossover
Description copied from interface:CrossoverOperatorCombine two parents into one or more new children.- Specified by:
crossoverin interfaceCrossoverOperator<PolygonChromosome>- Parameters:
p1- first selected parentp2- second selected parentrng- source of randomness- Returns:
- non-null, non-empty list of non-null children
-