From de4fa6a04fbefb0bf69fe3996100b9e300fb10c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Montan=CC=83ana?= Date: Sat, 23 Sep 2023 10:30:39 +0200 Subject: [PATCH] Add color to totals --- src/Platform/BestResults.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/Platform/BestResults.cc b/src/Platform/BestResults.cc index c902c15..6e69043 100644 --- a/src/Platform/BestResults.cc +++ b/src/Platform/BestResults.cc @@ -252,14 +252,34 @@ namespace platform { } cout << endl; cout << Colors::GREEN() << setw(30) << " Totals..................."; + double max = 0.0; + for (const auto& total : totals) { + if (total.second > max) { + max = total.second; + } + } for (const auto& model : models) { - cout << setw(12) << setprecision(9) << fixed << totals[model] << " "; + string efectiveColor = Colors::GREEN(); + if (totals[model] == max) { + efectiveColor = Colors::RED(); + } + cout << efectiveColor << setw(12) << setprecision(9) << fixed << totals[model] << " "; } // Output the averaged ranks cout << endl; + int min = 1; + for (const auto& rank : ranks) { + if (rank.second < min) { + min = rank.second; + } + } cout << Colors::GREEN() << setw(30) << " Averaged ranks..........."; for (const auto& model : models) { - cout << setw(12) << setprecision(10) << fixed << (double)ranks[model] / (double)origin.size() << " "; + string efectiveColor = Colors::GREEN(); + if (ranks[model] == min) { + efectiveColor = Colors::RED(); + } + cout << efectiveColor << setw(12) << setprecision(10) << fixed << (double)ranks[model] / (double)origin.size() << " "; } cout << endl; }