Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/08/16 20:10:16 (8 years ago)
Author:
gkronber
Message:

#2581: made policies storable and added iteration of best solution to results

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/MctsSymbolicRegression/MctsSymbolicRegressionAlgorithm.cs

    r13658 r13669  
    209209      Results.Add(new Result("Iterations", iterations));
    210210
     211      var bestSolutionIteration = new IntValue(0);
     212      Results.Add(new Result("Best solution iteration", bestSolutionIteration));
     213
    211214      var table = new DataTable("Qualities");
    212215      table.Rows.Add(new DataRow("Best quality"));
     
    261264      double bestQ = 0.0;
    262265      double curBestQ = 0.0;
    263       double q = 0.0;
    264266      int n = 0;
    265267      // Loop until iteration limit reached or canceled.
     
    267269        cancellationToken.ThrowIfCancellationRequested();
    268270
    269         q = MctsSymbolicRegressionStatic.MakeStep(state);
     271        var q = MctsSymbolicRegressionStatic.MakeStep(state);
    270272        sumQ += q; // sum of qs in the last updateinterval iterations
    271273        curBestQ = Math.Max(q, curBestQ); // the best q in the last updateinterval iterations
     
    274276        // iteration results
    275277        if (n == updateInterval) {
     278          if (bestQ > bestQuality.Value) {
     279            bestSolutionIteration.Value = i;
     280          }
    276281          bestQuality.Value = bestQ;
    277282          curQuality.Value = curBestQ;
     
    295300      // final results
    296301      if (n > 0) {
     302        if (bestQ > bestQuality.Value) {
     303          bestSolutionIteration.Value = iterations.Value + n;
     304        }
    297305        bestQuality.Value = bestQ;
    298306        curQuality.Value = curBestQ;
Note: See TracChangeset for help on using the changeset viewer.