Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12890


Ignore:
Timestamp:
08/21/15 22:18:16 (9 years ago)
Author:
abeham
Message:

#2431: fixed a bug in the iterated algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Analysis/3.3/Optimizers/IteratedAlgorithm.cs

    r12864 r12890  
    383383          }
    384384        }
    385         if (improvement) {
    386           var totalExecTime = execTime + perClock.Rows.First().Values.Last().Item1;
    387           qualityValues.Add(Tuple.Create(totalExecTime, best));
    388           restartValues.Add(Tuple.Create(totalExecTime, (double)restarts));
    389         }
     385        if (!improvement) {
     386          qualityValues.RemoveAt(qualityValues.Count - 1);
     387          restartValues.RemoveAt(restartValues.Count - 1);
     388        }
     389        var totalExecTime = execTime + perClock.Rows.First().Values.Last().Item1;
     390        qualityValues.Add(Tuple.Create(totalExecTime, best));
     391        restartValues.Add(Tuple.Create(totalExecTime, (double)restarts));
    390392      }
    391393    }
     
    425427          }
    426428        }
    427         if (improvement) { // add the best quality again as value with highest evaluations
    428           var totalEvaluations = evaluations + perEvaluations.Rows.First().Values.Last().Item1;
    429           qualityValues.Add(Tuple.Create(totalEvaluations, best));
    430           restartValues.Add(Tuple.Create(totalEvaluations, (double)restarts));
    431         }
     429        if (!improvement) {
     430          // add the best quality again as value with highest evaluations
     431          qualityValues.RemoveAt(qualityValues.Count - 1);
     432          restartValues.RemoveAt(restartValues.Count - 1);
     433        }
     434        var totalEvaluations = evaluations + perEvaluations.Rows.First().Values.Last().Item1;
     435        qualityValues.Add(Tuple.Create(totalEvaluations, best));
     436        restartValues.Add(Tuple.Create(totalEvaluations, (double)restarts));
    432437      }
    433438    }
Note: See TracChangeset for help on using the changeset viewer.