Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/05/17 17:50:03 (8 years ago)
Author:
abeham
Message:

#2701:

  • Added BinaryVectorEqualityComparer (identical to the one in the P3 plugin) to binaryvector plugin
  • Added delinking for absolute coded permutations
  • Some tweaks
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/LinearLinkage/LinearLinkageMemPR.cs

    r14544 r14550  
    3232using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3333using HeuristicLab.PluginInfrastructure;
    34 using HeuristicLab.Random;
    3534
    3635namespace HeuristicLab.Algorithms.MemPR.Grouping {
     
    5554    }
    5655
    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;
    6360      return true;
    6461    }
     
    256253      var evaluations = 1;
    257254      ISingleObjectiveSolutionScope<LinearLinkage> offspring = null;
    258       for (; evaluations < Context.LocalSearchEvaluations; evaluations++) {
     255      for (; evaluations < p1Scope.Solution.Length; evaluations++) {
    259256        var code = GroupCrossover.Apply(Context.Random, p1Scope.Solution, p2Scope.Solution);
    260257        if (cache.Contains(code)) {
     
    297294          m.Apply(probe.Solution);
    298295          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
    299298          if (delink && distAfter > distBefore || !delink && distAfter < distBefore) {
    300299            var beforeQ = probe.Fitness;
Note: See TracChangeset for help on using the changeset viewer.