mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[yul-phaser] Add --show-initial-population option
This commit is contained in:
@@ -31,6 +31,7 @@ using namespace solidity::phaser;
|
||||
void AlgorithmRunner::run(GeneticAlgorithm& _algorithm)
|
||||
{
|
||||
populationAutosave();
|
||||
printInitialPopulation();
|
||||
cacheClear();
|
||||
|
||||
for (size_t round = 0; !m_options.maxRounds.has_value() || round < m_options.maxRounds.value(); ++round)
|
||||
@@ -47,6 +48,15 @@ void AlgorithmRunner::run(GeneticAlgorithm& _algorithm)
|
||||
}
|
||||
}
|
||||
|
||||
void AlgorithmRunner::printInitialPopulation() const
|
||||
{
|
||||
if (!m_options.showInitialPopulation)
|
||||
return;
|
||||
|
||||
m_outputStream << "---------- INITIAL POPULATION ----------" << endl;
|
||||
m_outputStream << m_population;
|
||||
}
|
||||
|
||||
void AlgorithmRunner::populationAutosave() const
|
||||
{
|
||||
if (!m_options.populationAutosaveFile.has_value())
|
||||
|
||||
Reference in New Issue
Block a user