[yul-phaser] Mutations: Add mutationSequence()

This commit is contained in:
Kamil Śliwak
2020-04-06 19:06:08 +02:00
parent 0837a62d5c
commit 59011fcde6
3 changed files with 48 additions and 0 deletions
+12
View File
@@ -95,6 +95,18 @@ function<Mutation> phaser::alternativeMutations(
};
}
function<Mutation> phaser::mutationSequence(vector<function<Mutation>> _mutations)
{
return [=](Chromosome const& _chromosome)
{
Chromosome mutatedChromosome = _chromosome;
for (size_t i = 0; i < _mutations.size(); ++i)
mutatedChromosome = _mutations[i](move(mutatedChromosome));
return mutatedChromosome;
};
}
namespace
{