From: Hamed Gorjiara Date: Tue, 22 Oct 2019 20:57:45 +0000 (-0700) Subject: BUGFIX: when ONE or TWO tuner cannot solve a problem X-Git-Url: http://plrg.eecs.uci.edu/git/?p=satune.git;a=commitdiff_plain;h=8ae6061f7eae5614e9f8bf1ccd9ad80bef9cd768 BUGFIX: when ONE or TWO tuner cannot solve a problem --- 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++) {