Bug Fix: when a tuner cannot solve any problems ...
authorHamed Gorjiara <hgorjiar@uci.edu>
Thu, 21 Mar 2019 20:01:53 +0000 (13:01 -0700)
committerHamed Gorjiara <hgorjiar@uci.edu>
Thu, 21 Mar 2019 20:01:53 +0000 (13:01 -0700)
src/Tuner/basictuner.cc
src/Tuner/satuner.cc

index 889b543..a2d93bf 100644 (file)
@@ -160,6 +160,7 @@ long long BasicTuner::evaluate(Problem *problem, TunerRecord *tuner) {
 
        //Do run
        snprintf(buffer, sizeof(buffer), "./run.sh deserializerun %s %u tuner%u result%u > log%u", problem->getProblem(), maxtime, execnum, execnum, execnum);
+       model_print("Running: %s\n", buffer);
        int status = system(buffer);
 
        long long metric = -1;
index 61c9c35..0c405ae 100644 (file)
@@ -153,10 +153,19 @@ void SATuner::tune() {
                        TunerRecord *tuner2 = tunerV->get(tunerNumber + i);
                        ASSERT( tunerNumber + i < tunerV->getSize());
                        model_print("Tuner1 = %d \tTuner2 = %d\n", tuner1->getTunerNumber(), tuner2->getTunerNumber());
-                       ASSERT(scores.contains(tuner1));
-                       ASSERT(scores.contains(tuner2));
-                       int score1 = scores.get(tuner1);
-                       int score2 = scores.get(tuner2);
+                       
+                       int score1, score2;
+                       if(!scores.contains(tuner1)){
+                               score1 = 0;
+                       }else {
+                               score1 = scores.get(tuner1);
+                       }
+                       if(!scores.contains(tuner2)){
+                               score2=0;
+                       }else {
+                               score2= scores.get(tuner2);
+                       }
+                       
                        if( score2 > score1 ){
                                removeTunerIndex(tunerV, i, allplaces);
                        } else if( score2 < score1){