- Timestamp:
- 01/05/17 17:50:03 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/LinearLinkage/LinearLinkageMemPR.cs
r14544 r14550 32 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 33 using HeuristicLab.PluginInfrastructure; 34 using HeuristicLab.Random;35 34 36 35 namespace HeuristicLab.Algorithms.MemPR.Grouping { … … 55 54 } 56 55 57 protected override bool Eq(ISingleObjectiveSolutionScope<LinearLinkage> a, ISingleObjectiveSolutionScope<LinearLinkage> b) { 58 var s1 = a.Solution; 59 var s2 = b.Solution; 60 if (s1.Length != s2.Length) return false; 61 for (var i = 0; i < s1.Length; i++) 62 if (s1[i] != s2[i]) return false; 56 protected override bool Eq(LinearLinkage a, LinearLinkage b) { 57 if (a.Length != b.Length) return false; 58 for (var i = 0; i < a.Length; i++) 59 if (a[i] != b[i]) return false; 63 60 return true; 64 61 } … … 256 253 var evaluations = 1; 257 254 ISingleObjectiveSolutionScope<LinearLinkage> offspring = null; 258 for (; evaluations < Context.LocalSearchEvaluations; evaluations++) {255 for (; evaluations < p1Scope.Solution.Length; evaluations++) { 259 256 var code = GroupCrossover.Apply(Context.Random, p1Scope.Solution, p2Scope.Solution); 260 257 if (cache.Contains(code)) { … … 297 294 m.Apply(probe.Solution); 298 295 var distAfter = Dist(probe, b); 296 // consider all moves that would increase the distance between probe and b 297 // or decrease it depending on whether we do delinking or relinking 299 298 if (delink && distAfter > distBefore || !delink && distAfter < distBefore) { 300 299 var beforeQ = probe.Fitness;
Note: See TracChangeset
for help on using the changeset viewer.