From 45af550cf9adc09953bb887cfc134369a13b3a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana=20G=C3=B3mez?= Date: Wed, 24 Jul 2024 18:40:59 +0200 Subject: [PATCH] Change time showed in report --- src/manage/ManageScreen.cpp | 8 +++++++- src/reports/ReportConsole.cpp | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/manage/ManageScreen.cpp b/src/manage/ManageScreen.cpp index ebc0973..20d55c4 100644 --- a/src/manage/ManageScreen.cpp +++ b/src/manage/ManageScreen.cpp @@ -396,8 +396,14 @@ namespace platform { OptionsMenu& menu = output_type == OutputType::EXPERIMENTS ? main_menu : list_menu; bool parserError = true; // force the first iteration while (parserError) { + int index_menu; auto [min_index, max_index] = paginator[static_cast(output_type)].getOffset(); - std::tie(option, index, parserError) = menu.parse('r', min_index, max_index); + std::tie(option, index_menu, parserError) = menu.parse('r', min_index, max_index); + if (output_type == OutputType::EXPERIMENTS) { + index = index_menu; + } else { + subIndex = index_menu; + } if (min_columns > cols) { std::cerr << "Make screen bigger to fit the results! " + std::to_string(min_columns - cols) + " columns needed! " << std::endl; return; diff --git a/src/reports/ReportConsole.cpp b/src/reports/ReportConsole.cpp index ccc5a87..4e924bd 100644 --- a/src/reports/ReportConsole.cpp +++ b/src/reports/ReportConsole.cpp @@ -2,6 +2,7 @@ #include #include "best/BestScore.h" #include "common/CLocale.h" +#include "common/Timer.h" #include "ReportConsole.h" #include "main/Scores.h" @@ -30,8 +31,9 @@ namespace platform { "Random seeds: " + fromVector("seeds") + " Discretized: " + (data["discretized"].get() ? "True" : "False") + algorithm + " Stratified: " + (data["stratified"].get() ? "True" : "False") + " Smooth Strategy: " + smooth ); - oss << "Execution took " << std::setprecision(2) << std::fixed << data["duration"].get() - << " seconds, " << data["duration"].get() / 3600 << " hours, on " << data["platform"].get(); + Timer timer; + oss << "Execution took " << timer.translate2String(data["duration"].get()) + << " on " << data["platform"].get() << " Language: " << data["language"].get(); sheader << headerLine(oss.str()); sheader << headerLine("Score is " + data["score_name"].get()); sheader << std::string(MAXL, '*') << std::endl;