Skip to content

Commit

Permalink
minor corrections to CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Sep 21, 2023
1 parent 978df20 commit 6389f97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions source/Cli/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace
file << ", " << name << " (color " << i << ")";
}
};
file << "Time step";
writeLabelAllColors("Cells");
writeLabelAllColors("Self-replicators");
writeLabelAllColors("Viruses");
Expand Down Expand Up @@ -59,9 +60,10 @@ namespace
};
auto writeFloatValueAllColors = [&file](ColorVector<float> const& values) {
for (int i = 0; i < MAX_COLORS; ++i) {
file << ", " << StringHelper::format(values[i], 8);
file << ", " << values[i];
}
};
file << simController->getCurrentTimestep();
writeIntValueAllColors(statistics.timeline.timestep.numCells);
writeIntValueAllColors(statistics.timeline.timestep.numSelfReplicators);
writeIntValueAllColors(statistics.timeline.timestep.numViruses);
Expand Down Expand Up @@ -122,7 +124,7 @@ int main(int argc, char** argv)
simController->newSimulation(simData.auxiliaryData.timestep, simData.auxiliaryData.generalSettings, simData.auxiliaryData.simulationParameters);
simController->setClusteredSimulationData(simData.mainData);

std::cout << "Use " << simController->getGpuName() << std::endl;
std::cout << "Device: " << simController->getGpuName() << std::endl;
std::cout << "Start simulation" << std::endl;
simController->calcTimesteps(timesteps);
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now() - startTimepoint).count();
Expand Down
4 changes: 2 additions & 2 deletions source/Gui/StatisticsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ void _StatisticsWindow::onSaveStatistics()
return;
}

file << "time step";
file << "Time step";
auto writeLabelAllColors = [&file](auto const& name) {
for (int i = 0; i < MAX_COLORS; ++i) {
file << ", " << name << " (color " << i << ")";
Expand Down Expand Up @@ -552,7 +552,7 @@ void _StatisticsWindow::onSaveStatistics()
};
auto writeDoubleValueAllColors = [&file](DataPoint const& dataPoint) {
for (int i = 0; i < MAX_COLORS; ++i) {
file << ", " << StringHelper::format(toFloat(dataPoint.values[i]), 8);
file << ", " << dataPoint.values[i];
}
};
for (auto const& dataPointCollection : _longtermStatistics.dataPointCollectionHistory) {
Expand Down

0 comments on commit 6389f97

Please sign in to comment.