- Timestamp:
- 02/17/17 12:51:44 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3/Permutation/PermutationMemPR.cs
r14563 r14678 534 534 var evaluations = 0; 535 535 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 }; 537 542 best = double.NaN; 538 543 Encodings.PermutationEncoding.Permutation bestChild = null; … … 566 571 var idx2 = invChild[p2[idx1]]; 567 572 Swap(child, idx1, idx2); 573 thisPath.Add(Tuple.Create((Encodings.PermutationEncoding.Permutation)child.Clone(), (bestChange - Context.LowerBound) / (Context.AverageQuality - Context.LowerBound))); 568 574 invChild[child[idx1]] = idx1; 569 575 invChild[child[idx2]] = idx2; … … 582 588 } 583 589 Context.IncrementEvaluatedSolutions(evaluations); 590 if (thisPath.Count > 5) 591 Context.RelinkedPaths.AddPath(thisPath); 584 592 585 593 if (VALIDATE && bestChild != null && !bestChild.Validate()) throw new ArgumentException("Relinking produced invalid child");
Note: See TracChangeset
for help on using the changeset viewer.