Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/14/16 20:45:46 (8 years ago)
Author:
abeham
Message:

#2701:

  • Updated LLE encoding
    • Made folder for version 3.4
    • Added conversion from and to LLE-b representation (back-links)
    • Updated moves and movegenerator to replace bidirectionaldictionary with LLE-b representation
  • Updated MemPR (linear linkage)
    • Updated tabu walk
  • Added test for conversion between LLE-e and LLE and LLE-b and LLE
  • Updated test for move apply/undo and added test for applying in sequence
Location:
branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/HeuristicLab.Algorithms.MemPR-3.3.csproj

    r14487 r14492  
    162162      <Private>False</Private>
    163163    </ProjectReference>
    164     <ProjectReference Include="..\..\HeuristicLab.Encodings.LinearLinkageEncoding\3.3\HeuristicLab.Encodings.LinearLinkageEncoding-3.4.csproj">
     164    <ProjectReference Include="..\..\HeuristicLab.Encodings.LinearLinkageEncoding\3.4\HeuristicLab.Encodings.LinearLinkageEncoding-3.4.csproj">
    165165      <Project>{166507c9-ef26-4370-bb80-699742a29d4f}</Project>
    166166      <Name>HeuristicLab.Encodings.LinearLinkageEncoding-3.4</Name>
     167      <Private>False</Private>
    167168    </ProjectReference>
    168169    <ProjectReference Include="..\..\HeuristicLab.Encodings.PermutationEncoding\3.3\HeuristicLab.Encodings.PermutationEncoding-3.3.csproj">
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/LinearLinkage/LinearLinkageMemPR.cs

    r14487 r14492  
    120120        tabu[i, current[i]] = quality;
    121121      }
    122      
     122
    123123      // this dictionary holds the last relevant links
    124       var links = new BidirectionalDictionary<int, int>();
     124      var groupItems = new List<int>();
     125      var lleb = current.ToBackLinks();
    125126      Move bestOfTheRest = null;
    126127      var bestOfTheRestF = double.NaN;
     
    128129      for (var iter = 0; iter < int.MaxValue; iter++) {
    129130        // clear the dictionary before a new pass through the array is made
    130         links.Clear();
     131        groupItems.Clear();
    131132        for (var i = 0; i < current.Length; i++) {
    132133          if (subspace != null && !subspace[i]) {
    133             links.RemoveBySecond(i);
    134             links.Add(i, current[i]);
     134            if (lleb[i] != i)
     135              groupItems.Remove(lleb[i]);
     136            groupItems.Add(i);
    135137            continue;
    136138          }
     
    141143            if (bestOfTheRest != null) {
    142144              bestOfTheRest.Apply(current);
     145              bestOfTheRest.ApplyToLLEb(lleb);
    143146              currentScope.Fitness = bestOfTheRestF;
    144147              quality = bestOfTheRestF;
     
    162165            break;
    163166          } else {
    164             foreach (var move in MoveGenerator.GenerateForItem(i, next, links)) {
     167            foreach (var move in MoveGenerator.GenerateForItem(i, groupItems, current, lleb)) {
    165168              // we intend to break link i -> next
    166169              var qualityToBreak = tabu[i, next];
     
    185188                if (isAspired) bestQuality = quality;
    186189
    187                 move.UpdateLinks(links);
     190                move.ApplyToLLEb(lleb);
    188191
    189192                if (FitnessComparer.IsBetter(maximization, moveF, bestOfTheWalkF)) {
     
    209212            }
    210213          }
    211           links.RemoveBySecond(i);
    212           links.Add(i, current[i]);
     214          if (lleb[i] != i)
     215            groupItems.Remove(lleb[i]);
     216          groupItems.Add(i);
    213217          if (evaluations >= maxEvals) break;
    214218          if (token.IsCancellationRequested) break;
  • branches/MemPRAlgorithm/HeuristicLab.Algorithms.MemPR/3.3/Plugin.cs

    r14420 r14492  
    3333  [PluginDependency("HeuristicLab.Data", "3.3")]
    3434  [PluginDependency("HeuristicLab.Encodings.BinaryVectorEncoding", "3.3")]
     35  [PluginDependency("HeuristicLab.Encodings.LinearLinkageEncoding", "3.4")]
     36  [PluginDependency("HeuristicLab.Encodings.PermutationEncoding", "3.3")]
    3537  [PluginDependency("HeuristicLab.Operators", "3.3")]
    3638  [PluginDependency("HeuristicLab.Optimization", "3.3")]
Note: See TracChangeset for help on using the changeset viewer.