Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/17/12 15:23:30 (13 years ago)
Author:
abeham
Message:

#1614

  • added first version of GRASP+PR algorithm
Location:
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/ExtensionMethods.cs

    r7319 r7345  
    7474    }
    7575
     76    /// <summary>
     77    /// Walks an operator graph in that it jumps from one operator to all its operator parameters and yields each operator it touches.
     78    /// Cycles are detected and not walked twice.
     79    /// </summary>
     80    /// <param name="initial">The operator where the walk starts (is also yielded).</param>
     81    /// <returns>An enumeration of all the operators that could be found.</returns>
     82    public static IEnumerable<IOperator> Walk(this IOperator initial) {
     83      var open = new Stack<IOperator>();
     84      var visited = new HashSet<IOperator>();
     85      open.Push(initial);
     86
     87      while (open.Any()) {
     88        IOperator current = open.Pop();
     89        if (visited.Contains(current)) continue;
     90        visited.Add(current);
     91
     92        foreach (var parameter in current.Parameters.OfType<IValueParameter>()) {
     93          if (typeof(IOperator).IsAssignableFrom(parameter.DataType)) {
     94            if (parameter.Value != null)
     95              open.Push((IOperator)parameter.Value);
     96          }
     97        }
     98
     99        yield return current;
     100      }
     101    }
     102
    76103  }
    77104}
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Plugin.cs.frame

    r7319 r7345  
    2323
    2424namespace HeuristicLab.Problems.GeneralizedQuadraticAssignment {
    25   [Plugin("HeuristicLab.Problems.GeneralizedQuadraticAssignment", "3.3.5.$WCREV$")]
     25  [Plugin("HeuristicLab.Problems.GeneralizedQuadraticAssignment", "3.3.6.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Problems.GeneralizedQuadraticAssignment-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Properties/AssemblyInfo.cs.frame

    r7319 r7345  
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.5.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.6.$WCREV$")]
Note: See TracChangeset for help on using the changeset viewer.