MCPcopy Create free account
hub / github.com/argotorg/solidity / crossover

Method crossover

tools/yulPhaser/Population.cpp:105–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105Population Population::crossover(PairSelection const& _selection, std::function<Crossover> _crossover) const
106{
107 std::vector<Individual> crossedIndividuals;
108 for (auto const& [i, j]: _selection.materialise(m_individuals.size()))
109 {
110 auto childChromosome = _crossover(
111 m_individuals[i].chromosome,
112 m_individuals[j].chromosome
113 );
114 crossedIndividuals.emplace_back(std::move(childChromosome), *m_fitnessMetric);
115 }
116
117 return Population(m_fitnessMetric, crossedIndividuals);
118}
119
120std::tuple<Population, Population> Population::symmetricCrossoverWithRemainder(
121 PairSelection const& _selection,

Callers 2

runNextRoundMethod · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80

Calls 3

PopulationClass · 0.70
materialiseMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected