From 8ae6061f7eae5614e9f8bf1ccd9ad80bef9cd768 Mon Sep 17 00:00:00 2001 From: Hamed Gorjiara Date: Tue, 22 Oct 2019 13:57:45 -0700 Subject: [PATCH] BUGFIX: when ONE or TWO tuner cannot solve a problem --- src/Tuner/comptuner.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Tuner/comptuner.cc b/src/Tuner/comptuner.cc index 64e58a0..d630f2d 100644 --- a/src/Tuner/comptuner.cc +++ b/src/Tuner/comptuner.cc @@ -4,6 +4,7 @@ #include "searchtuner.h" #include #include +#include #include "solver_interface.h" CompTuner::CompTuner(uint _budget, uint _timeout) : @@ -30,12 +31,14 @@ void CompTuner::findBestTwoTuners() { for (uint l = 0; l < problems.getSize(); l++) { Problem *problem = problems.get(l); long long time1 = tuner1->getTime(problem); + if(time1 == -1){ + time1=LLONG_MAX; + } long long time2 = tuner2->getTime(problem); - long long minTime =DBL_MAX; - if(time1 != -1 || time2 != -1){ - minTime = min(time1,time2); + if(time2 == -1){ + time2 = LLONG_MAX; } - mintimes[l] = pow(minTime, (double)1 / problems.getSize()); + mintimes[l] = pow(min(time1,time2), (double)1 / problems.getSize()); } double result = 1; for (uint l = 0; l < problems.getSize(); l++) { -- 2.34.1