mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] Change the design of crossover operators so that they produce a single chromosome rather than a pair
This commit is contained in:
@@ -108,12 +108,11 @@ Population Population::crossover(PairSelection const& _selection, function<Cross
|
||||
vector<Individual> crossedIndividuals;
|
||||
for (auto const& [i, j]: _selection.materialise(m_individuals.size()))
|
||||
{
|
||||
auto [childChromosome1, childChromosome2] = _crossover(
|
||||
auto childChromosome = _crossover(
|
||||
m_individuals[i].chromosome,
|
||||
m_individuals[j].chromosome
|
||||
);
|
||||
crossedIndividuals.emplace_back(move(childChromosome1), *m_fitnessMetric);
|
||||
crossedIndividuals.emplace_back(move(childChromosome2), *m_fitnessMetric);
|
||||
crossedIndividuals.emplace_back(move(childChromosome), *m_fitnessMetric);
|
||||
}
|
||||
|
||||
return Population(m_fitnessMetric, crossedIndividuals);
|
||||
|
||||
Reference in New Issue
Block a user