Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/17 12:51:44 (7 years ago)
Author:
abeham
Message:

#2457: worked on problem instance detection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3/Permutation/PermutationMemPR.cs

    r14563 r14678  
    534534      var evaluations = 0;
    535535      var child = (Encodings.PermutationEncoding.Permutation)p1.Clone();
    536 
     536      var childF = eval(child, token);
     537      evaluations++;
     538
     539      var thisPath = new List<Tuple<Encodings.PermutationEncoding.Permutation, double>>() {
     540        Tuple.Create((Encodings.PermutationEncoding.Permutation)child.Clone(), (childF - Context.LowerBound) / (Context.AverageQuality - Context.LowerBound))
     541      };
    537542      best = double.NaN;
    538543      Encodings.PermutationEncoding.Permutation bestChild = null;
     
    566571          var idx2 = invChild[p2[idx1]];
    567572          Swap(child, idx1, idx2);
     573          thisPath.Add(Tuple.Create((Encodings.PermutationEncoding.Permutation)child.Clone(), (bestChange - Context.LowerBound) / (Context.AverageQuality - Context.LowerBound)));
    568574          invChild[child[idx1]] = idx1;
    569575          invChild[child[idx2]] = idx2;
     
    582588      }
    583589      Context.IncrementEvaluatedSolutions(evaluations);
     590      if (thisPath.Count > 5)
     591        Context.RelinkedPaths.AddPath(thisPath);
    584592
    585593      if (VALIDATE && bestChild != null && !bestChild.Validate()) throw new ArgumentException("Relinking produced invalid child");
Note: See TracChangeset for help on using the changeset viewer.