Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8213


Ignore:
Timestamp:
07/04/12 16:12:15 (12 years ago)
Author:
bburlacu
Message:

#1772: Performance improvements for the GenealogyGraph. Minor refactoring to VisualGenealogyGraphArc and VisualGenealogyGraphNode classes. Added new functionality to the SymbolicExpressionTreeFragmentsAnalyzer, minor refactoring in the other two analyzers. Refactored View code. Updated project references and plugin dependencies and added HeuristicLab.Problems.DataAnalysis.Symbolic to the branch.

Location:
branches/HeuristicLab.EvolutionaryTracking
Files:
2 added
6 deleted
39 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking

    • Property svn:ignore
      •  

        old new  
         1*.suo
        12_ReSharper.HeuristicLab.Tracking
        23bin
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4

    • Property svn:ignore
      •  

        old new  
         1*.user
        12bin
        23obj
        3 HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin.cs
        4 *.user
        5 *.vs10x
        6 Plugin.cs
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/TracingSymbolicExpressionTreeCrossover.cs

    r7997 r8213  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.Linq;
    2524using HeuristicLab.Common;
     
    117116
    118117      // save the nodes of parent0 in a list so we can track what modifications are made by crossover
    119       var nodes0 = Parents[0].IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>;
     118      var nodes0 = Parents[0].IterateNodesBreadth().ToList();
    120119
    121       //perform crossover
     120      // perform crossover
    122121      Child = Crossover(Random, Parents[0], Parents[1]);
    123122
    124123      // create another list of parent0's nodes, so we can compare it with the first list to see what changed
    125       var nodes1 = Child.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>;
     124      var nodes1 = Child.IterateNodesBreadth().ToList();
    126125
    127126      // compare the two nodes lists and check the difference (comparing node references so we avoid false functional identity).
     
    130129      for (i = 0; i != min; ++i)
    131130        if (nodes0[i] != nodes1[i]) break;
    132       if (i == min) i = 0;
    133 
    134131      // add heredity information into the global variables
    135132      GlobalTraceMap[Child] = originalParents; // map child to its corresponding parents from the previous generation
    136       GlobalFragmentMap[Child] = new GenericWrapper<ISymbolicExpressionTreeNode>(nodes1[i]); // map child to the index of its fragment
     133      GlobalFragmentMap[Child] = new GenericWrapper<SymbolicExpressionTreeNode>(i == min ? null : (SymbolicExpressionTreeNode)nodes1[i]); // map child to the index of its fragment
    137134      return base.Apply();
    138135    }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/CutPoint.cs

    r7785 r8213  
    6565    }
    6666
    67     public static CutPoint GetCutPoint(ISymbolicExpressionTree parent, ISymbolicExpressionTree child) {
    68       return GetCutPoint(parent.Root, child.Root);
    69     }
     67    //public static CutPoint GetCutPoint(ISymbolicExpressionTree parent, ISymbolicExpressionTree child) {
     68    //  return GetCutPoint(parent.Root, child.Root);
     69    //}
    7070
    71     public static CutPoint GetCutPoint(ISymbolicExpressionTree parent, ISymbolicExpressionTreeNode child) {
    72       return GetCutPoint(parent.Root, child);
    73     }
     71    //public static CutPoint GetCutPoint(ISymbolicExpressionTree parent, ISymbolicExpressionTreeNode child) {
     72    //  return GetCutPoint(parent.Root, child);
     73    //}
    7474
    75     public static CutPoint GetCutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTree child) {
    76       return GetCutPoint(parent, child.Root);
    77     }
     75    //public static CutPoint GetCutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTree child) {
     76    //  return GetCutPoint(parent, child.Root);
     77    //}
    7878
    7979    // child is the result of a genetic operation on parent
    8080    // this method returns the index on which the two individuals start to differ
    81     public static CutPoint GetCutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
    82       var e1 = parent.IterateNodesPostfix().GetEnumerator();
    83       var e2 = child.IterateNodesPostfix().GetEnumerator();
    84       int pos = -1;
    85       var comparer = new SymbolicExpressionTreeNodeComparer((int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact);
    86       while (e1.MoveNext() && e2.MoveNext())
    87         if (comparer.Equals(e1.Current, e2.Current))
    88           ++pos;
    89       return pos == -1 ? null : new CutPoint(parent, pos);
    90     }
     81    //public static CutPoint GetCutPoint(ISymbolicExpressionTreeNode parent, ISymbolicExpressionTreeNode child) {
     82    //  var e1 = parent.IterateNodesPostfix().GetEnumerator();
     83    //  var e2 = child.IterateNodesPostfix().GetEnumerator();
     84    //  int pos = -1;
     85    //  var comparer = new SymbolicExpressionTreeNodeSimilarityComparer((int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact);
     86    //  while (e1.MoveNext() && e2.MoveNext())
     87    //    if (comparer.Equals(e1.Current, e2.Current))
     88    //      ++pos;
     89    //  return pos == -1 ? null : new CutPoint(parent, pos);
     90    //}
    9191  }
    9292}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/GenericWrapper.cs

    r7997 r8213  
    55namespace HeuristicLab.EvolutionaryTracking {
    66  [Item("Generic wrapper", "Wrapper class for non-item HeuristicLab objects")]
     7  [StorableClass]
    78  public class GenericWrapper<T> : NamedItem where T : class {
    89    public T Content { get; private set; }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r7997 r8213  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    5151    <DebugType>pdbonly</DebugType>
    5252    <Optimize>true</Optimize>
    53     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     53    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    5454    <DefineConstants>TRACE</DefineConstants>
    5555    <ErrorReport>prompt</ErrorReport>
     
    132132    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
    133133      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
    134     </Reference>
    135     <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    136       <SpecificVersion>False</SpecificVersion>
    137       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
    138134    </Reference>
    139135    <Reference Include="HeuristicLab.Random-3.3">
     
    170166    <Compile Include="Compiler\Instruction.cs" />
    171167    <Compile Include="Compiler\SymbolicExpressionTreeCompiler.cs" />
     168    <None Include="Plugin.cs.frame" />
    172169    <Compile Include="Creators\TracingSymbolicExpressionTreeCreator.cs" />
    173170    <Compile Include="Creators\FullTreeCreator.cs">
     
    178175    </Compile>
    179176    <Compile Include="Creators\RampedHalfAndHalfTreeCreator.cs" />
    180     <Compile Include="Crossovers\AssortativeSymbolicExpressionTreeCrossover.cs" />
    181177    <Compile Include="Crossovers\TracingSymbolicExpressionTreeCrossover.cs" />
    182178    <Compile Include="GenericWrapper.cs" />
     
    212208    <Compile Include="SymbolicExpressionGrammar.cs" />
    213209    <Compile Include="SymbolicExpressionTreeGrammar.cs" />
    214     <Compile Include="SymbolicExpressionTreeMatching.cs" />
    215210    <Compile Include="SymbolicExpressionTreeTopLevelNode.cs" />
    216211    <Compile Include="Crossovers\SubtreeCrossover.cs">
     
    238233  <ItemGroup>
    239234    <None Include="HeuristicLab.snk" />
    240     <None Include="Plugin.cs.frame" />
    241235    <None Include="Properties\AssemblyInfo.cs.frame" />
    242236  </ItemGroup>
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj.user

    r7997 r8213  
    77  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
    88    <StartAction>Program</StartAction>
    9     <StartProgram>C:\Users\bburlacu\Desktop\HL-Core\Trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
     9    <StartProgram>C:\Users\bburlacu\Projects\HeuristicLab\Trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
    1010  </PropertyGroup>
    1111  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/TracingSymbolicExpressionTreeManipulator.cs

    r7997 r8213  
    2121
    2222using System;
    23 using System.Collections.Generic;
     23using System.Linq;
    2424using HeuristicLab.Common;
    2525using HeuristicLab.Core;
     
    9696        gScope.Variables.Add(new Variable(GlobalFragmentMapParameterName, new CloneMapType()));
    9797
     98      int i = 0;
    9899      if (GlobalTraceMap.ContainsKey(tree)) {
    99100        // tree was affected by crossover before mutation
     
    102103        // In order to preserve information, a tree clone is created before mutation and added to the trace map.
    103104        var clone = (IItem)tree.Clone();
    104         GlobalTraceMap[clone] = GlobalTraceMap[tree];
    105         GlobalTraceMap[tree] = new ItemList<IItem> { clone };
    106         GlobalFragmentMap[clone] = GlobalFragmentMap[tree];
     105        GlobalTraceMap[clone] = GlobalTraceMap[tree]; // clone gets parents of tree
     106        GlobalTraceMap[tree] = new ItemList<IItem> { clone }; // tree gets clone as parent
     107        var nodes = tree.IterateNodesBreadth().ToList();
     108        for (i = 0; i != nodes.Count; ++i) {
     109          if ((GlobalFragmentMap[tree] as GenericWrapper<SymbolicExpressionTreeNode>).Content == nodes[i]) break;
     110        }
     111        var fragment = (SymbolicExpressionTreeNode)(((SymbolicExpressionTree)clone).IterateNodesBreadth().ElementAt(i));
     112        GlobalFragmentMap[clone] = new GenericWrapper<SymbolicExpressionTreeNode>(fragment);
    107113      } else {
    108114        var original = GlobalCloneMap[tree];
    109115        GlobalTraceMap[tree] = new ItemList<IItem> { original };
    110116      }
    111       var nodes0 = tree.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>;
     117      var nodes0 = tree.IterateNodesBreadth().ToList();
    112118      Manipulate(RandomParameter.ActualValue, tree);
    113       var nodes1 = tree.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>;
    114       int i, min = Math.Max(nodes0.Count, nodes1.Count);
     119      var nodes1 = tree.IterateNodesBreadth().ToList();
     120      int min = Math.Min(nodes0.Count, nodes1.Count);
    115121      for (i = 0; i != min; ++i)
    116122        if (nodes0[i] != nodes1[i]) break;
    117       if (i == min) i = 0;
    118       GlobalFragmentMap[tree] = new GenericWrapper<ISymbolicExpressionTreeNode>(nodes1[i]);
    119 
     123      GlobalFragmentMap[tree] = new GenericWrapper<SymbolicExpressionTreeNode>(i == min ? null : (SymbolicExpressionTreeNode)nodes1[i]);
    120124      return base.Apply();
    121125    }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs

    r7997 r8213  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
    2724namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    28   [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7817")]
     25  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7997")]
    2926  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)]
    3027  [PluginDependency("HeuristicLab.Analysis", "3.3")]
     
    3835  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3936  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     37
    4038  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin : PluginBase {
    4139  }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs.frame

    r7439 r8213  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
    2724namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
    28   [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.$WCREV$")]
     25  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7997")]
    2926  [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)]
    3027  [PluginDependency("HeuristicLab.Analysis", "3.3")]
     
    3835  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3936  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     37
    4038  public class HeuristicLabEncodingsSymbolicExpressionTreeEncodingPlugin : PluginBase {
    4139  }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Properties

    • Property svn:ignore
      •  

        old new  
        1 *.bak
         1AssemblyInfo.cs
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views

    • Property svn:ignore set to
      *.user
      bin
      obj
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.Designer.cs

    r7779 r8213  
    5959
    6060    #endregion
    61 
    62     //private System.Windows.Forms.ToolTip toolTip;
    6361  }
    6462}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs

    r7817 r8213  
    2626using System.Linq;
    2727using System.Windows.Forms;
     28using HeuristicLab.Common;
    2829using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2930using HeuristicLab.Visualization;
     
    3334    private Dictionary<GenealogyGraphNode, List<VisualGenealogyGraphNode>> _visualNodeMap;
    3435    private Dictionary<Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>, VisualGenealogyGraphArc> _visualArcMap;
    35     private const int Diameter = 20;
    36     private int x, y;
    37     private const int Cx = 30, Cy = 30;
    38 
     36    private const int Diameter = 20; // node diameter
     37    private int x, y; // coordinates for positioning each node
     38    private const int Cx = 30, Cy = 30; // position increments
    3939    private VisualGenealogyGraphNode _selectedGenealogyGraphNode;
    4040    public VisualGenealogyGraphNode SelectedGenealogyGraphNode { get { return _selectedGenealogyGraphNode; } }
     
    7474      for (int i = 0; i != count; ++i) {
    7575        // propagate elites from successive layers
    76         if (currRank == (int)currRank) prevLayer = currLayer;
     76        bool f = currRank % 1 == 0;
     77        if (f) // if the rank is an integer, then we need to propagate elites
     78          prevLayer = currLayer;
    7779        currRank = layers.ElementAt(i).Key;
    7880        currLayer = layers.ElementAt(i).ToList();
    79         if (i > 0 && currRank == (int)currRank) {
    80           // this code injects elites that propagate from the previous generation into the current graph layer, so that they can be represented as visual nodes
    81           int prevCount = prevLayer.Count(node => node.IsElite);
    82           int currCount = currLayer.Count(node => node.IsElite);
    83           for (int j = currCount; j < prevCount; ++j) currLayer.Add(prevLayer.ElementAt(j));
     81        if (i > 0 && f) {
     82          // this following code injects elites that propagate from the previous generation into the current graph layer,
     83          // so that they can be represented as visual nodes
     84          int prevEliteCount = prevLayer.Count(node => node.IsElite);
     85          int currEliteCount = currLayer.Count(node => node.IsElite);
     86          for (int j = currEliteCount; j < prevEliteCount; ++j)
     87            currLayer.Add(prevLayer.ElementAt(j));
    8488        }
    8589        currLayer.Sort(); // uses the CompareTo() method inside the GenealogyGraphNode class
    86 
    8790        foreach (var node in currLayer) {
    8891          var pen = new Pen(Color.LightGray);
    8992          var nl = Environment.NewLine;
    9093          var visualNode = new VisualGenealogyGraphNode(Chart, x, y, x + Diameter, y + Diameter, pen, null) {
    91             Data = node, ToolTipText = "Id: " + node.Label + nl + "Rank: " + node.Rank + nl + "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl + "IsElite: " + node.IsElite
     94            Data = node,
     95            ToolTipText = "Id: " + node.Label + nl +
     96                          "Rank: " + node.Rank + nl +
     97                          "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl +
     98                          "IsElite: " + node.IsElite
    9299          };
    93100          Chart.Group.Add(visualNode);
    94           if (!_visualNodeMap.ContainsKey(node)) _visualNodeMap[node] = new List<VisualGenealogyGraphNode>();
     101          if (!_visualNodeMap.ContainsKey(node))
     102            _visualNodeMap[node] = new List<VisualGenealogyGraphNode>();
    95103          _visualNodeMap[node].Add(visualNode);
    96           // connect visual nodes that actually represent the same individual in the genealogy graph (this applies for elites) with a dashed line
     104          // connect visual nodes that actually represent the same individual
     105          // in the genealogy graph (this applies for elites) with a dashed line
    97106          if (_visualNodeMap[node].Count > 1) {
    98107            for (int c = _visualNodeMap[node].Count; c >= 2; --c) {
     
    104113          }
    105114          x += Cx; // increment horizontal coordinate
    106           if (node.InEdges == null) continue;
     115          if (node.InEdges == null && _visualNodeMap.ContainsKey(node)) continue;
    107116          // add visual edges
    108117          foreach (var arc in node.InEdges) {
    109118            var parent = arc.Target;
    110119            // find the visual parent node that is closest to the current node in terms of vertical distance
    111             var visualParent = _visualNodeMap[parent].Where(p => p.Center.Y > visualNode.Center.Y).OrderByDescending(p => p.Center.Y).Last();
     120            var visualParent = _visualNodeMap[parent].Where(p => p.Center.Y >= visualNode.Center.Y).OrderByDescending(p => p.Center.Y).Last();
    112121            DashStyle style;
    113             if (visualParent.Data == visualNode.Data) {
     122            if (visualParent.Data == visualNode.Data) { // if the graph nodes represent the same elite individual
    114123              style = DashStyle.Dash;
    115124            } else {
     
    143152        base.pictureBox_MouseUp(sender, e);
    144153      else { // select mode
    145         Chart.UpdateEnabled = false;
    146         // clear colors
    147         foreach (var primitive in Chart.Group.Primitives) {
    148           if (primitive is VisualGenealogyGraphNode) {
    149             var visualNode = primitive as VisualGenealogyGraphNode;
    150             visualNode.Brush = null;
    151           } else if (primitive is VisualGenealogyGraphArc) {
    152             var visualArc = primitive as VisualGenealogyGraphArc;
    153             if (visualArc.Source.Data != visualArc.Target.Data) visualArc.Pen.Brush = new SolidBrush(Color.Transparent);
    154           }
    155         }
    156154        // get selected node
    157155        var visualNodes = Chart.GetAllPrimitives(e.Location).Where(p => p is VisualGenealogyGraphNode).ToList();
    158156        if (visualNodes.Count > 0) {
     157          if (_selectedGenealogyGraphNode == visualNodes[0]) return;
    159158          _selectedGenealogyGraphNode = visualNodes[0] as VisualGenealogyGraphNode;
    160           // color selected node and its genealogy
    161159          if (_selectedGenealogyGraphNode == null) return;
    162           // use special highlighting for the currently selected genealogy graph node
     160          // new node has been selected, clean up
     161          Chart.UpdateEnabled = false;
     162          // clear colors
     163          ClearAllNodes();
     164          // use a rectangle to highlight the currently selected genealogy graph node
    163165          var center = _selectedGenealogyGraphNode.Center;
    164166          var size = _selectedGenealogyGraphNode.Size;
    165           double x1 = center.X - size.Width / 2, x2 = x1 + size.Width;
    166           double y1 = center.Y - size.Height / 2, y2 = y1 + size.Height;
    167           if (_targetRectangle != null) _targetRectangle.SetPosition(x1, y1, x2, y2);
    168           else {
     167          double x1 = center.X - size.Width / 2;
     168          double x2 = x1 + size.Width;
     169          double y1 = center.Y - size.Height / 2;
     170          double y2 = y1 + size.Height;
     171          if (_targetRectangle == null) {
    169172            _targetRectangle = new Visualization.Rectangle(Chart, x1, y1, x2, y2, new Pen(Color.Black), null);
    170173            Chart.Group.Add(_targetRectangle);
     174          } else {
     175            _targetRectangle.SetPosition(x1, y1, x2, y2);
    171176          }
    172177          var gNode = _selectedGenealogyGraphNode.Data; // genealogy graph node (representing an individual in the population)
    173178          double rank = gNode.Rank;
     179          // ancestors
    174180          var ancestors = gNode.Ancestors().Where(a => a.Rank < rank).ToList();
    175181          ancestors.Add(gNode);
    176           // highlight selected node and its ancestry
    177           foreach (var node in ancestors.SelectMany(n => _visualNodeMap[n])) {
    178             node.Brush = new SolidBrush(node.ToColor());
    179             if (node.IncomingArcs != null && node == _visualNodeMap[node.Data].First()) {
    180               foreach (var arc in node.IncomingArcs) {
    181                 if (arc.Source.Data == node.Data) continue;
    182                 var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
    183                 var end = new Point((int)arc.End.X, (int)arc.End.Y);
    184                 arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
    185               }
    186             }
    187           }
    188           // highlight the descendants
     182          // descendants
    189183          var descendants = gNode.Descendants().Where(a => a.Rank > rank).ToList();
    190184          descendants.Add(gNode);
    191           foreach (var node in descendants.SelectMany(n => _visualNodeMap[n])) {
     185          // highlight ancestors
     186          foreach (var node in ancestors.Select(n => _visualNodeMap[n][0])) {
    192187            node.Brush = new SolidBrush(node.ToColor());
    193             foreach (var arc in node.IncomingArcs.Where(a => descendants.Contains(a.Source.Data))) {
    194               if (arc.Source.Data == node.Data) continue;
    195               var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
    196               var end = new Point((int)arc.End.X, (int)arc.End.Y);
    197               arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
    198             }
     188            if (node.IncomingArcs != null)
     189              foreach (var arc in node.IncomingArcs)
     190                if (arc.Source.Data != arc.Target.Data && arc.Source == _visualNodeMap[arc.Source.Data][0]) {
     191                  var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
     192                  var end = new Point((int)arc.End.X, (int)arc.End.Y);
     193                  arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
     194                }
     195          }
     196          // highlight descendants
     197          foreach (var node in descendants.Select(n => _visualNodeMap[n][0])) {
     198            node.Brush = new SolidBrush(node.ToColor());
     199            if (node.OutgoingArcs != null)
     200              foreach (var arc in node.OutgoingArcs)
     201                if (arc.Source.Data != arc.Target.Data && arc.Target == _visualNodeMap[arc.Target.Data][0]) {
     202                  var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
     203                  var end = new Point((int)arc.End.X, (int)arc.End.Y);
     204                  arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
     205                }
    199206          }
    200207        } else {
     
    206213        if (_selectedGenealogyGraphNode != null)
    207214          /* emit clicked event */
    208           GenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e);
     215          OnGenealogyGraphNodeClicked(_selectedGenealogyGraphNode, e);
    209216      }
    210217    }
    211218
    212219    public void ClearAllNodes() {
     220      foreach (var primitive in Chart.Group.Primitives) {
     221        if (primitive.Brush != null)
     222          primitive.Brush = null;
     223        if (primitive is VisualGenealogyGraphArc) {
     224          var arc = primitive as VisualGenealogyGraphArc;
     225          if (arc.Source.Data != arc.Target.Data && primitive.Pen.Brush != null)
     226            primitive.Pen.Brush = new SolidBrush(Color.Transparent);
     227        }
     228      }
     229    }
     230
     231    public void HighlightLineage(IEnumerable<GenealogyGraphNode> nodes) {
     232      foreach (var node in nodes.SelectMany(n => _visualNodeMap[n])) {
     233        node.Brush = new SolidBrush(node.ToColor());
     234        if (node.IncomingArcs != null && node == _visualNodeMap[node.Data][0]) {
     235          foreach (var arc in node.IncomingArcs) {
     236            if (arc.Source.Data == node.Data) continue;
     237            var start = new Point((int)arc.Start.X, (int)arc.Start.Y);
     238            var end = new Point((int)arc.End.X, (int)arc.End.Y);
     239            arc.Pen.Brush = new LinearGradientBrush(start, end, arc.Source.ToColor(), arc.Target.ToColor());
     240          }
     241        }
     242      }
     243    }
     244
     245    public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees, Color color) {
     246      foreach (var visualNode in trees.Select(tree => _visualNodeMap[Graph.GetNode(tree)]).SelectMany(vList => vList))
     247        visualNode.Brush = new SolidBrush(color);
     248    }
     249
     250    public void HighlightInDegree() {
    213251      Chart.UpdateEnabled = false;
    214       foreach (var node in Chart.Group.Primitives.Where(p => p is VisualGenealogyGraphNode).Cast<VisualGenealogyGraphNode>()) {
    215         node.Brush = null;
    216         if (node.IncomingArcs != null)
    217           foreach (var arc in node.IncomingArcs)
    218             if (arc.Source.Data != node.Data) arc.Pen = new Pen(Color.Transparent);
     252      ClearAllNodes();
     253      var graphNodes = Graph.Values.ToList();
     254      double min = graphNodes.Min(x => x.InEdges == null ? 0 : x.InEdges.Count);
     255      double max = graphNodes.Max(x => x.InEdges == null ? 0 : x.InEdges.Count);
     256      foreach (var graphNode in graphNodes) {
     257        var visualNode = _visualNodeMap[graphNode][0];
     258        double deg = graphNode.InEdges == null ? 0 : graphNode.InEdges.Count;
     259        var color = Color.FromArgb((int)(1 - deg / max) * 255, (int)(deg / max * 255), 100);
     260        visualNode.Brush = new SolidBrush(color);
    219261      }
    220262      Chart.UpdateEnabled = true;
     
    222264    }
    223265
    224     public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees, Color color) {
     266    public void HighlightOutDegree() {
    225267      Chart.UpdateEnabled = false;
    226       foreach (var visualNode in trees.Select(tree => _visualNodeMap[Graph.GetNode(tree)]).SelectMany(vList => vList))
    227         visualNode.Brush = new SolidBrush(color);
    228 
     268      ClearAllNodes();
     269      var graphNodes = Graph.Values.ToList();
     270      double min = graphNodes.Min(x => x.OutEdges == null ? 0 : x.OutEdges.Count);
     271      double max = graphNodes.Max(x => x.OutEdges == null ? 0 : x.OutEdges.Count);
     272      foreach (var graphNode in graphNodes) {
     273        var visualNode = _visualNodeMap[graphNode][0];
     274        double deg = graphNode.OutEdges == null ? 0 : graphNode.OutEdges.Count;
     275        int index = (int)(deg / max * ColorGradient.Colors.Count) - 1;
     276        if (index < 0) index = 0;
     277        visualNode.Brush = new SolidBrush(ColorGradient.Colors[index]);
     278      }
    229279      Chart.UpdateEnabled = true;
    230280      Chart.EnforceUpdate();
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.Designer.cs

    r7779 r8213  
    2727      this.mainTableLayout = new System.Windows.Forms.TableLayoutPanel();
    2828      this.splitContainer = new System.Windows.Forms.SplitContainer();
    29       this.topControlBox = new System.Windows.Forms.GroupBox();
    30       this.similarityModeLabel = new System.Windows.Forms.Label();
    31       this.similarityModeSelector = new System.Windows.Forms.ComboBox();
    32       this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
    3329      this.genealogyTableLayout = new System.Windows.Forms.TableLayoutPanel();
    3430      this.graphControlsPanel = new System.Windows.Forms.Panel();
     
    3632      this.moveModeButton = new System.Windows.Forms.RadioButton();
    3733      this.zoomModeButton = new System.Windows.Forms.RadioButton();
     34      this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
     35      this.topControlBox = new System.Windows.Forms.GroupBox();
     36      this.similarityModeLabel = new System.Windows.Forms.Label();
     37      this.similarityModeSelector = new System.Windows.Forms.ComboBox();
    3838      this.genealogyGraphChart = new HeuristicLab.EvolutionaryTracking.Views.GenealogyGraphChart();
     39      this.inDegreeButton = new System.Windows.Forms.Button();
     40      this.outDegreeButton = new System.Windows.Forms.Button();
    3941      this.mainTableLayout.SuspendLayout();
    4042      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     
    4244      this.splitContainer.Panel2.SuspendLayout();
    4345      this.splitContainer.SuspendLayout();
    44       this.topControlBox.SuspendLayout();
    4546      this.genealogyTableLayout.SuspendLayout();
    4647      this.graphControlsPanel.SuspendLayout();
     48      this.topControlBox.SuspendLayout();
    4749      this.SuspendLayout();
    4850      //
     
    8385      this.splitContainer.TabIndex = 7;
    8486      //
    85       // topControlBox
    86       //
    87       this.topControlBox.Controls.Add(this.similarityModeLabel);
    88       this.topControlBox.Controls.Add(this.similarityModeSelector);
    89       this.topControlBox.Dock = System.Windows.Forms.DockStyle.Fill;
    90       this.topControlBox.Location = new System.Drawing.Point(3, 3);
    91       this.topControlBox.Name = "topControlBox";
    92       this.topControlBox.Size = new System.Drawing.Size(522, 44);
    93       this.topControlBox.TabIndex = 6;
    94       this.topControlBox.TabStop = false;
    95       this.topControlBox.Text = "Controls";
    96       //
    97       // similarityModeLabel
    98       //
    99       this.similarityModeLabel.AutoSize = true;
    100       this.similarityModeLabel.Location = new System.Drawing.Point(6, 20);
    101       this.similarityModeLabel.Name = "similarityModeLabel";
    102       this.similarityModeLabel.Size = new System.Drawing.Size(80, 13);
    103       this.similarityModeLabel.TabIndex = 1;
    104       this.similarityModeLabel.Text = "Similarity Mode:";
    105       //
    106       // similarityModeSelector
    107       //
    108       this.similarityModeSelector.FormattingEnabled = true;
    109       this.similarityModeSelector.Items.AddRange(new object[] {
    110             "Exact",
    111             "High",
    112             "Relaxed"});
    113       this.similarityModeSelector.Location = new System.Drawing.Point(92, 17);
    114       this.similarityModeSelector.Name = "similarityModeSelector";
    115       this.similarityModeSelector.Size = new System.Drawing.Size(148, 21);
    116       this.similarityModeSelector.TabIndex = 0;
    117       this.similarityModeSelector.SelectedIndexChanged += new System.EventHandler(this.similarityModeSelector_SelectedIndexChanged);
    118       //
    119       // symbolicExpressionTreeChart
    120       //
    121       this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
    122       this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
    123       this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
    124       this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);
    125       this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart";
    126       this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(275, 385);
    127       this.symbolicExpressionTreeChart.Spacing = 5;
    128       this.symbolicExpressionTreeChart.SuspendRepaint = false;
    129       this.symbolicExpressionTreeChart.TabIndex = 2;
    130       this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
    131       this.symbolicExpressionTreeChart.Tree = null;
    132       //
    13387      // genealogyTableLayout
    13488      //
     
    148102      // graphControlsPanel
    149103      //
     104      this.graphControlsPanel.Controls.Add(this.outDegreeButton);
     105      this.graphControlsPanel.Controls.Add(this.inDegreeButton);
    150106      this.graphControlsPanel.Controls.Add(this.selectModeButton);
    151107      this.graphControlsPanel.Controls.Add(this.moveModeButton);
     
    160116      this.selectModeButton.Appearance = System.Windows.Forms.Appearance.Button;
    161117      this.selectModeButton.AutoSize = true;
    162       this.selectModeButton.Location = new System.Drawing.Point(103, 3);
     118      this.selectModeButton.Location = new System.Drawing.Point(65, 3);
    163119      this.selectModeButton.Name = "selectModeButton";
    164       this.selectModeButton.Size = new System.Drawing.Size(47, 23);
     120      this.selectModeButton.Size = new System.Drawing.Size(24, 23);
    165121      this.selectModeButton.TabIndex = 5;
    166122      this.selectModeButton.TabStop = true;
    167       this.selectModeButton.Text = "Select";
     123      this.selectModeButton.Text = "S";
    168124      this.selectModeButton.UseVisualStyleBackColor = true;
    169125      this.selectModeButton.CheckedChanged += new System.EventHandler(this.selectModeButton_CheckedChanged);
     
    175131      this.moveModeButton.Location = new System.Drawing.Point(3, 3);
    176132      this.moveModeButton.Name = "moveModeButton";
    177       this.moveModeButton.Size = new System.Drawing.Size(44, 23);
     133      this.moveModeButton.Size = new System.Drawing.Size(26, 23);
    178134      this.moveModeButton.TabIndex = 3;
    179135      this.moveModeButton.TabStop = true;
    180       this.moveModeButton.Text = "Move";
     136      this.moveModeButton.Text = "M";
    181137      this.moveModeButton.UseVisualStyleBackColor = true;
    182138      this.moveModeButton.CheckedChanged += new System.EventHandler(this.moveModeButton_CheckedChanged);
     
    186142      this.zoomModeButton.Appearance = System.Windows.Forms.Appearance.Button;
    187143      this.zoomModeButton.AutoSize = true;
    188       this.zoomModeButton.Location = new System.Drawing.Point(53, 3);
     144      this.zoomModeButton.Location = new System.Drawing.Point(35, 3);
    189145      this.zoomModeButton.Name = "zoomModeButton";
    190       this.zoomModeButton.Size = new System.Drawing.Size(44, 23);
     146      this.zoomModeButton.Size = new System.Drawing.Size(24, 23);
    191147      this.zoomModeButton.TabIndex = 4;
    192148      this.zoomModeButton.TabStop = true;
    193       this.zoomModeButton.Text = "Zoom";
     149      this.zoomModeButton.Text = "Z";
    194150      this.zoomModeButton.UseVisualStyleBackColor = true;
    195151      this.zoomModeButton.CheckedChanged += new System.EventHandler(this.zoomModeButton_CheckedChanged);
     152      //
     153      // symbolicExpressionTreeChart
     154      //
     155      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
     156      this.symbolicExpressionTreeChart.Dock = System.Windows.Forms.DockStyle.Fill;
     157      this.symbolicExpressionTreeChart.LineColor = System.Drawing.Color.Black;
     158      this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0);
     159      this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart";
     160      this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(275, 385);
     161      this.symbolicExpressionTreeChart.Spacing = 5;
     162      this.symbolicExpressionTreeChart.SuspendRepaint = false;
     163      this.symbolicExpressionTreeChart.TabIndex = 2;
     164      this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
     165      this.symbolicExpressionTreeChart.Tree = null;
     166      //
     167      // topControlBox
     168      //
     169      this.topControlBox.Controls.Add(this.similarityModeLabel);
     170      this.topControlBox.Controls.Add(this.similarityModeSelector);
     171      this.topControlBox.Dock = System.Windows.Forms.DockStyle.Fill;
     172      this.topControlBox.Location = new System.Drawing.Point(3, 3);
     173      this.topControlBox.Name = "topControlBox";
     174      this.topControlBox.Size = new System.Drawing.Size(522, 44);
     175      this.topControlBox.TabIndex = 6;
     176      this.topControlBox.TabStop = false;
     177      this.topControlBox.Text = "Controls";
     178      //
     179      // similarityModeLabel
     180      //
     181      this.similarityModeLabel.AutoSize = true;
     182      this.similarityModeLabel.Location = new System.Drawing.Point(6, 20);
     183      this.similarityModeLabel.Name = "similarityModeLabel";
     184      this.similarityModeLabel.Size = new System.Drawing.Size(80, 13);
     185      this.similarityModeLabel.TabIndex = 1;
     186      this.similarityModeLabel.Text = "Similarity Mode:";
     187      //
     188      // similarityModeSelector
     189      //
     190      this.similarityModeSelector.FormattingEnabled = true;
     191      this.similarityModeSelector.Items.AddRange(new object[] {
     192            "Exact",
     193            "High",
     194            "Relaxed"});
     195      this.similarityModeSelector.Location = new System.Drawing.Point(92, 17);
     196      this.similarityModeSelector.Name = "similarityModeSelector";
     197      this.similarityModeSelector.Size = new System.Drawing.Size(148, 21);
     198      this.similarityModeSelector.TabIndex = 0;
     199      this.similarityModeSelector.SelectedIndexChanged += new System.EventHandler(this.similarityModeSelector_SelectedIndexChanged);
    196200      //
    197201      // genealogyGraphChart
     
    204208      this.genealogyGraphChart.Size = new System.Drawing.Size(233, 343);
    205209      this.genealogyGraphChart.TabIndex = 2;
     210      //
     211      // inDegreeButton
     212      //
     213      this.inDegreeButton.AutoSize = true;
     214      this.inDegreeButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     215      this.inDegreeButton.Location = new System.Drawing.Point(95, 3);
     216      this.inDegreeButton.Name = "inDegreeButton";
     217      this.inDegreeButton.Size = new System.Drawing.Size(28, 23);
     218      this.inDegreeButton.TabIndex = 6;
     219      this.inDegreeButton.Text = "IN";
     220      this.inDegreeButton.UseVisualStyleBackColor = true;
     221      this.inDegreeButton.Click += new System.EventHandler(this.inDegreeButton_Click);
     222      //
     223      // outDegreeButton
     224      //
     225      this.outDegreeButton.AutoSize = true;
     226      this.outDegreeButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     227      this.outDegreeButton.Location = new System.Drawing.Point(129, 3);
     228      this.outDegreeButton.Name = "outDegreeButton";
     229      this.outDegreeButton.Size = new System.Drawing.Size(40, 23);
     230      this.outDegreeButton.TabIndex = 7;
     231      this.outDegreeButton.Text = "OUT";
     232      this.outDegreeButton.UseVisualStyleBackColor = true;
     233      this.outDegreeButton.Click += new System.EventHandler(this.outDegreeButton_Click);
    206234      //
    207235      // GenealogyGraphView
     
    217245      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    218246      this.splitContainer.ResumeLayout(false);
    219       this.topControlBox.ResumeLayout(false);
    220       this.topControlBox.PerformLayout();
    221247      this.genealogyTableLayout.ResumeLayout(false);
    222248      this.graphControlsPanel.ResumeLayout(false);
    223249      this.graphControlsPanel.PerformLayout();
     250      this.topControlBox.ResumeLayout(false);
     251      this.topControlBox.PerformLayout();
    224252      this.ResumeLayout(false);
    225253
     
    240268    private System.Windows.Forms.RadioButton moveModeButton;
    241269    private System.Windows.Forms.RadioButton zoomModeButton;
     270    private System.Windows.Forms.Button inDegreeButton;
     271    private System.Windows.Forms.Button outDegreeButton;
    242272
    243273  }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs

    r7997 r8213  
    2929using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    3030using HeuristicLab.MainForm;
     31using HeuristicLab.Problems.DataAnalysis.Symbolic;
    3132using HeuristicLab.Visualization;
    3233
     
    9293      var genealogyGraphNode = (GenealogyGraphNode)visualGenealogyGraphNode.Data;
    9394      symbolicExpressionTreeChart.Tree = (ISymbolicExpressionTree)genealogyGraphNode.Data;
     95      // highlight the relevant fragment in the symbolic expression tree
    9496      if (_selectedVisualSymbolicExpressionTreeNode != null) {
    9597        var nodes = symbolicExpressionTreeChart.Tree.IterateNodesBreadth() as List<ISymbolicExpressionTreeNode>;
     
    140142      var treeNode = _selectedVisualSymbolicExpressionTreeNode.SymbolicExpressionTreeNode;
    141143      Color[] colors = { Color.LightSkyBlue, Color.PaleGreen, Color.Tan };
    142 
     144      // update visual graph nodes
     145      genealogyGraphChart.Chart.UpdateEnabled = false;
    143146      genealogyGraphChart.ClearAllNodes(); // clear node colors
    144147      // color each graph node according to the degree to which it matches the selected tree fragment
     
    147150        if (owners.Any()) genealogyGraphChart.HighlightNodes(owners, colors[i]); // highlight matching individuals from the genealogy
    148151      }
     152      genealogyGraphChart.Chart.UpdateEnabled = true;
     153      genealogyGraphChart.Chart.EnforceUpdate();
    149154
    150155      // highlight subtree nodes in the tree chart
     
    164169      var owners = genealogyGraphChart.Graph.TraceFragment(treeNode, similarityModeSelector.SelectedIndex).ToList();
    165170      if (owners.Any()) {
     171        genealogyGraphChart.Chart.UpdateEnabled = false;
    166172        genealogyGraphChart.ClearAllNodes(); // clear the fill color of all nodes
    167173        genealogyGraphChart.HighlightNodes(owners, Color.LightSkyBlue); // highlight matching individuals from the genealogy
     174        genealogyGraphChart.Chart.UpdateEnabled = true;
    168175      }
     176      genealogyGraphChart.Chart.EnforceUpdate();
    169177      // highlight subtree nodes in the tree chart
    170178      foreach (var visualNode in symbolicExpressionTreeChart.Tree.IterateNodesPostfix().Select(node => symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node)))
     
    174182    }
    175183    #endregion
     184
     185    private void inDegreeButton_Click(object sender, EventArgs e) {
     186      genealogyGraphChart.HighlightInDegree();
     187    }
     188
     189    private void outDegreeButton_Click(object sender, EventArgs e) {
     190      genealogyGraphChart.HighlightOutDegree();
     191    }
    176192  }
    177193}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj

    r7779 r8213  
    1818    <DebugType>full</DebugType>
    1919    <Optimize>false</Optimize>
    20     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     20    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    2121    <DefineConstants>DEBUG;TRACE</DefineConstants>
    2222    <ErrorReport>prompt</ErrorReport>
     
    2626    <DebugType>pdbonly</DebugType>
    2727    <Optimize>true</Optimize>
    28     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     28    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    2929    <DefineConstants>TRACE</DefineConstants>
    3030    <ErrorReport>prompt</ErrorReport>
     
    6767      <SpecificVersion>False</SpecificVersion>
    6868      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
    69     </Reference>
    70     <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    71       <SpecificVersion>False</SpecificVersion>
    72       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
    7369    </Reference>
    7470    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     
    118114      <Name>HeuristicLab.EvolutionaryTracking-3.4</Name>
    119115    </ProjectReference>
     116    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     117      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
     118      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     119    </ProjectReference>
    120120  </ItemGroup>
    121121  <ItemGroup>
     
    123123  </ItemGroup>
    124124  <ItemGroup>
     125    <EmbeddedResource Include="GenealogyGraphView.resx">
     126      <DependentUpon>GenealogyGraphView.cs</DependentUpon>
     127    </EmbeddedResource>
    125128    <EmbeddedResource Include="Properties\Resources.resx">
    126129      <Generator>ResXFileCodeGenerator</Generator>
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/Plugin.cs

    r7779 r8213  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
     
    2825  [Plugin("HeuristicLab.EvolutionaryTracking.Views", "Provides controls and views for the evolution graph and related structures.", "3.4.2.7439")]
    2926  [PluginFile("HeuristicLab.EvolutionaryTracking.Views-3.4.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.Collections", "3.3")]
    31   [PluginDependency("HeuristicLab.Common", "3.3")]
    3227  [PluginDependency("HeuristicLab.Core", "3.3")]
    33   [PluginDependency("HeuristicLab.Data", "3.3")]
     28  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
    3429  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
    35   [PluginDependency("HeuristicLab.Operators", "3.3")]
    36   [PluginDependency("HeuristicLab.Optimization", "3.3")]
    37   [PluginDependency("HeuristicLab.Parameters", "3.3")]
    38   [PluginDependency("HeuristicLab.Persistence", "3.3")]
     30  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.4")]
     31  [PluginDependency("HeuristicLab.MainForm", "3.3")]
     32  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
     33  [PluginDependency("HeuristicLab.Visualization", "3.3")]
     34  [PluginDependency("HeuristicLab.EvolutionaryTracking", "3.4")]
     35  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
     36
    3937  public class HeuristicLabEvolutionaryTrackingPlugin : PluginBase {
    4038  }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/Properties

    • Property svn:ignore set to
      AssemblyInfo.cs
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphArc.cs

    r7779 r8213  
    2525
    2626namespace HeuristicLab.EvolutionaryTracking.Views {
    27   class VisualGenealogyGraphArc : Line {
     27  public class VisualGenealogyGraphArc : Line {
    2828    public VisualGenealogyGraphNode Source;
    2929    public VisualGenealogyGraphNode Target;
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs

    r7779 r8213  
    2828  public class VisualGenealogyGraphNode : Ellipse {
    2929    public GenealogyGraphNode Data { get; internal set; }
    30     internal List<VisualGenealogyGraphArc> IncomingArcs = new List<VisualGenealogyGraphArc>();
    31     internal List<VisualGenealogyGraphArc> OutgoingArcs = new List<VisualGenealogyGraphArc>();
     30    private List<VisualGenealogyGraphArc> _incomingArcs = new List<VisualGenealogyGraphArc>();
     31    private List<VisualGenealogyGraphArc> _outgoingArgs = new List<VisualGenealogyGraphArc>();
     32
     33    public List<VisualGenealogyGraphArc> IncomingArcs {
     34      get { return _incomingArcs; }
     35      set { _incomingArcs = value; }
     36    }
     37    public List<VisualGenealogyGraphArc> OutgoingArcs {
     38      get { return _outgoingArgs; }
     39      set { _outgoingArgs = value; }
     40    }
    3241
    3342    public VisualGenealogyGraphNode(IChart chart, PointD lowerLeft, PointD upperRight)
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4

    • Property svn:ignore
      •  

        old new  
         1*.user
         2bin
        13obj
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeFragmentsAnalyzer.cs

    r7997 r8213  
    3131using HeuristicLab.Parameters;
    3232using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     33using HeuristicLab.Problems.DataAnalysis;
     34using HeuristicLab.Problems.DataAnalysis.Symbolic;
     35using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    3336// type definitions for convenience
    3437using CloneMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Core.IItem, HeuristicLab.Core.IItem>;
     
    5457    private const string GlobalFragmentMapParameterName = "GlobalFragmentMap";
    5558    private const string GenerationsParameterName = "Generations";
     59    private const string SymbolicExpressionInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
     60    private const string SymbolicRegressionProblemDataParameterName = "ProblemData";
    5661    private const string FragmentStatisticsParameterName = "FragmentStatistics";
    5762    private const string FragmentLengthsDistributionParametersName = "FragmentLengths";
    5863    private const string FragmentFrequenciesParameterName = "FragmentFrequencies";
    5964
     65    // impact values calculator
     66    private SymbolicRegressionSolutionValuesCalculator _calculator = new SymbolicRegressionSolutionValuesCalculator();
     67
    6068    #region Parameter properties
    6169    public ValueParameter<IntValue> UpdateIntervalParameter {
     
    8189      get { return (LookupParameter<CloneMapType>)Parameters[GlobalFragmentMapParameterName]; }
    8290    }
    83     public LookupParameter<ItemList<ItemList<IItem>>> FragmentFrequenciesParameter {
    84       get { return (LookupParameter<ItemList<ItemList<IItem>>>)Parameters[FragmentFrequenciesParameterName]; }
     91    public LookupParameter<DataTable> FragmentFrequenciesParameter {
     92      get { return (LookupParameter<DataTable>)Parameters[FragmentFrequenciesParameterName]; }
    8593    }
    8694    public LookupParameter<DataTable> FragmentStatisticsParameter {
     
    102110      get { return (LookupParameter<CloneMapType>)Parameters[SecondaryCloneMapParameterName]; }
    103111    }
     112    // problem data, interpreter and evaluator
     113    public LookupParameter<SymbolicDataAnalysisExpressionTreeInterpreter> SymbolicExpressionInterpreterParameter {
     114      get { return (LookupParameter<SymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicExpressionInterpreterParameterName]; }
     115    }
     116    public LookupParameter<RegressionProblemData> SymbolicRegressionProblemDataParameter {
     117      get { return (LookupParameter<RegressionProblemData>)Parameters[SymbolicRegressionProblemDataParameterName]; }
     118    }
    104119    #endregion
    105120
     
    147162      get { return FragmentLengthsParameter.ActualValue; }
    148163    }
    149     public ItemList<ItemList<IItem>> FragmentFrequencies {
     164    public DataTable FragmentFrequencies {
    150165      get { return FragmentFrequenciesParameter.ActualValue; }
     166    }
     167    public SymbolicDataAnalysisExpressionTreeInterpreter SymbolicExpressionInterpreter {
     168      get { return SymbolicExpressionInterpreterParameter.ActualValue; }
     169    }
     170    public RegressionProblemData SymbolicRegressionProblemData {
     171      get { return SymbolicRegressionProblemDataParameter.ActualValue; }
    151172    }
    152173    #endregion
     
    180201      Parameters.Add(new LookupParameter<DataTable>(FragmentStatisticsParameterName, "The data table to store the fragment statistics."));
    181202      Parameters.Add(new LookupParameter<DataTable>(FragmentLengthsDistributionParametersName, "The data table to store the distribution of fragment lengths."));
    182       Parameters.Add(new LookupParameter<ItemList<ItemList<IItem>>>(FragmentFrequenciesParameterName, "A data structure for fragment frequencies"));
     203      Parameters.Add(new LookupParameter<DataTable>(FragmentFrequenciesParameterName, "A data structure for fragment frequencies"));
     204      // impact calculation
     205      Parameters.Add(new LookupParameter<SymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicExpressionInterpreterParameterName, "Interpreter for symbolic expression trees"));
     206      Parameters.Add(new LookupParameter<RegressionProblemData>(SymbolicRegressionProblemDataParameterName, "The symbolic data analysis problem."));
    183207      UpdateCounterParameter.Hidden = true;
    184208      UpdateIntervalParameter.Hidden = true;
     209
     210      //_calculator = new SymbolicRegressionSolutionValuesCalculator();
    185211    }
    186212    #region After deserialization code
     
    194220        Parameters.Add(new ValueParameter<IntValue>(UpdateCounterParameterName, "The value which counts how many times the operator was called since the last update", new IntValue(0)));
    195221        UpdateCounterParameter.Hidden = true;
     222      }
     223      if (!Parameters.ContainsKey(FragmentStatisticsParameterName)) {
     224        Parameters.Add(new LookupParameter<DataTable>(FragmentStatisticsParameterName, "The data table to store the fragment statistics."));
    196225      }
    197226      if (!Parameters.ContainsKey(FragmentLengthsDistributionParametersName)) {
     
    225254          results.Add(new Result("Fragment Statistics", FragmentStatistics));
    226255        }
     256        if (FragmentLengths == null) {
     257          FragmentLengthsParameter.ActualValue = new DataTable("Fragment Lengths", "Histograms for the distribution of fragment and individual lengths");
     258          FragmentLengths.VisualProperties.YAxisTitle = "Frequency";
     259          results.Add(new Result("Fragment Lengths", FragmentLengths));
     260        }
    227261        if (FragmentFrequencies == null) {
    228           FragmentFrequenciesParameter.ActualValue = new ItemList<ItemList<IItem>>();
     262          FragmentFrequenciesParameter.ActualValue = new DataTable("Fragment Frequencies", "Frequencies of good and high impact fragments");
     263          FragmentFrequencies.VisualProperties.YAxisTitle = "Frequency";
     264          results.Add(new Result("Fragment Frequencies", FragmentFrequencies));
    229265        }
    230266        if (SecondaryTraceMap == null) {
     
    270306            if (parentsLookup.ContainsKey(individual)) {
    271307              var fragmentItem = m.Value as SymbolicExpressionTreeNodeItem;
    272               goodFragments.Add(fragmentItem.Content);
    273               goodParents.AddRange(SecondaryTraceMap[individual].Cast<ISymbolicExpressionTree>());
    274               goodChildren.Add(individual);
     308              var fragment = fragmentItem.Content;
     309              if (fragment != null) {
     310                goodFragments.Add(fragmentItem.Content);
     311                goodParents.AddRange(SecondaryTraceMap[individual].Cast<ISymbolicExpressionTree>());
     312                goodChildren.Add(individual);
     313              }
    275314            }
    276315          }
    277           var allFragments = SecondaryFragmentMap.Values.Select(x => ((SymbolicExpressionTreeNodeItem)x).Content as ISymbolicExpressionTreeNode).ToList();
     316          var allFragments = SecondaryFragmentMap.Values.Where(x => ((SymbolicExpressionTreeNodeItem)x).Content != null).Select(x => ((SymbolicExpressionTreeNodeItem)x).Content as ISymbolicExpressionTreeNode).ToList();
     317          var highImpactFragments = new List<ISymbolicExpressionTreeNode>();
    278318          var allParents = SecondaryTraceMap.Values.SelectMany(x => x.Cast<ISymbolicExpressionTree>()).ToList();
    279319          var allChildren = SecondaryFragmentMap.Keys.Select(x => x as ISymbolicExpressionTree).ToList();
    280 
     320          // high impact fragments
     321          //foreach (var c in goodChildren) {
     322          //  var impactValues = _calculator.CalculateImpactValues(c, SymbolicExpressionInterpreter, SymbolicRegressionProblemData, 0, 0);
     323          //  var fragmentItem = SecondaryFragmentMap[c] as SymbolicExpressionTreeNodeItem;
     324          //  var fragment = fragmentItem.Content;
     325          //  if (fragment != null && impactValues[fragment] > 0.1)
     326          //    highImpactFragments.Add(fragment);
     327          //}
     328          FragmentFrequencies.Rows["Frequency of useful fragments"].Values.Add(goodFragments.Count);
     329          FragmentFrequencies.Rows["Frequency of high impact fragments"].Values.Add(highImpactFragments.Count);
    281330          FragmentStatistics.Rows["Fragment lengths (good)"].Values.Add(goodFragments.Average(x => x.GetLength()));
    282331          FragmentStatistics.Rows["Fragment lengths (all)"].Values.Add(allFragments.Average(x => x.GetLength()));
     332          //double avg = highImpactFragments.Count > 0 ? highImpactFragments.Average(x => x.GetLength()) : 0;
     333          //FragmentStatistics.Rows["Fragment lengths (high impact)"].Values.Add(avg);
    283334          FragmentStatistics.Rows["Parent lengths (good)"].Values.Add(goodParents.Average(x => x.Length));
    284335          FragmentStatistics.Rows["Parent lengths (all)"].Values.Add(allParents.Average(x => x.Length));
    285336          FragmentStatistics.Rows["Child lengths (good)"].Values.Add(goodChildren.Average(x => x.Length));
    286337          FragmentStatistics.Rows["Child lengths (all)"].Values.Add(allChildren.Average(x => x.Length));
    287           //FragmentStatistics.Rows["Exact similarity (good fragments)"].Values.Add(CalculateSimilarity(goodFragments, (int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact));
     338          FragmentStatistics.Rows["Avg visitation length (all children)"].Values.Add(allChildren.Average(x => VisitationLength(x)));
     339          FragmentStatistics.Rows["Avg visitation length (good children)"].Values.Add(goodChildren.Average(x => VisitationLength(x)));
     340          //FragmentStatistics.Rows["Exact similarity (good fragments)"].Values.Add(CalculateSimilarity(allFragments, (int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact));
     341          //foreach (var f in allFragments) f.SortSubtrees();
    288342          //FragmentStatistics.Rows["Exact similarity (all fragments)"].Values.Add(CalculateSimilarity(allFragments, (int)SymbolicExpressionTreeMatching.SimilarityLevel.Exact));
    289343
    290           //WriteFragmentFrequencies(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\FragmentFrequencies.dat");
     344          FragmentLengths.Rows["All fragments length distribution"].Values.Replace(allFragments.Select(x => (double)x.GetLength()));
     345          FragmentLengths.Rows["Useful fragments length distribution"].Values.Replace(goodFragments.Select(x => (double)x.GetLength()));
     346          FragmentLengths.Rows["All children length distribution"].Values.Replace(allChildren.Select(x => (double)x.Length));
     347          FragmentLengths.Rows["Useful children length distribution"].Values.Replace(goodChildren.Select(x => (double)x.Length));
    291348          #endregion
    292349        }
    293         // save the current generation so it can be compared to the following one, next time the analyzer is applied 
     350        // save the current generation so it can be compared to the following one, next time the analyzer is applied
    294351        SecondaryTraceMap.Clear();
    295352        foreach (var m in GlobalTraceMap)
    296353          SecondaryTraceMap.Add(m.Key, m.Value);
     354
    297355        SecondaryCloneMap.Clear();
    298356        foreach (var m in GlobalCloneMap)
    299357          SecondaryCloneMap.Add(m.Key, m.Value);
     358
    300359        SecondaryFragmentMap.Clear();
    301360        foreach (var m in GlobalFragmentMap)
     
    343402        });
    344403      }
     404      if (!FragmentStatistics.Rows.ContainsKey("Fragment lengths (high impact)")) {
     405        FragmentStatistics.Rows.Add(new DataRow("Fragment lengths (high impact)") {
     406          VisualProperties = { StartIndexZero = true }
     407        });
     408      }
     409      if (!FragmentStatistics.Rows.ContainsKey("Avg visitation length (all children)")) {
     410        FragmentStatistics.Rows.Add(new DataRow("Avg visitation length (all children)") {
     411          VisualProperties = { StartIndexZero = true }
     412        });
     413      }
     414      if (!FragmentStatistics.Rows.ContainsKey("Avg visitation length (good children)")) {
     415        FragmentStatistics.Rows.Add(new DataRow("Avg visitation length (good children)") {
     416          VisualProperties = { StartIndexZero = true }
     417        });
     418      }
    345419      // exact similarity
    346420      if (!FragmentStatistics.Rows.ContainsKey("Exact similarity (good fragments)")) {
     
    354428        });
    355429      }
    356     }
    357 
    358     private void WriteFragmentFrequencies(string path) {
    359       using (var file = new System.IO.StreamWriter(path)) {
    360         foreach (var f in FragmentFrequencies) {
    361           file.WriteLine(((SymbolicExpressionTreeNodeItem)f[0]).Content.GetLength() + " " + ((IntValue)f[1]).Value);
    362         }
    363       }
     430      if (!FragmentFrequencies.Rows.ContainsKey("Frequency of useful fragments")) {
     431        FragmentFrequencies.Rows.Add(new DataRow("Frequency of useful fragments") {
     432          VisualProperties = { StartIndexZero = true }
     433        });
     434      }
     435      if (!FragmentFrequencies.Rows.ContainsKey("Frequency of high impact fragments")) {
     436        FragmentFrequencies.Rows.Add(new DataRow("Frequency of high impact fragments") {
     437          VisualProperties = { StartIndexZero = true }
     438        });
     439      }
     440      double scaleFactor = 1.0;
     441      if (!FragmentLengths.Rows.ContainsKey("All fragments length distribution"))
     442        FragmentLengths.Rows.Add(new DataRow("All fragments length distribution") {
     443          VisualProperties = {
     444            StartIndexZero = true,
     445            ChartType = DataRowVisualProperties.DataRowChartType.Histogram,
     446            ScaleFactor = scaleFactor
     447          }
     448        });
     449      if (!FragmentLengths.Rows.ContainsKey("Useful fragments length distribution"))
     450        FragmentLengths.Rows.Add(new DataRow("Useful fragments length distribution") {
     451          VisualProperties = {
     452            StartIndexZero = true,
     453            ChartType = DataRowVisualProperties.DataRowChartType.Histogram,
     454            ScaleFactor = scaleFactor
     455          }
     456        });
     457      if (!FragmentLengths.Rows.ContainsKey("All children length distribution"))
     458        FragmentLengths.Rows.Add(new DataRow("All children length distribution") {
     459          VisualProperties = {
     460            StartIndexZero = true,
     461            ChartType = DataRowVisualProperties.DataRowChartType.Histogram,
     462            ScaleFactor = scaleFactor
     463          }
     464        });
     465      if (!FragmentLengths.Rows.ContainsKey("Useful children length distribution"))
     466        FragmentLengths.Rows.Add(new DataRow("Useful children length distribution") {
     467          VisualProperties = {
     468            StartIndexZero = true,
     469            ChartType = DataRowVisualProperties.DataRowChartType.Histogram,
     470            ScaleFactor = scaleFactor
     471          }
     472        });
     473    }
     474
     475    private static int VisitationLength(ISymbolicExpressionTree tree) {
     476      return VisitationLength(tree.Root);
     477    }
     478
     479    private static int VisitationLength(ISymbolicExpressionTreeNode node) {
     480      int sum = 0;
     481      foreach (var n in node.IterateNodesBreadth())
     482        sum += n.GetLength();
     483      return sum;
    364484    }
    365485
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeGenealogyAnalyzer.cs

    r7997 r8213  
    266266
    267267          foreach (var parent in parents) {
    268             object data = ((GenericWrapper<ISymbolicExpressionTreeNode>)GlobalFragmentMap[child]).Content;
     268            object data = ((GenericWrapper<SymbolicExpressionTreeNode>)GlobalFragmentMap[child]).Content;
    269269            graph.AddArc(parent, child, null, data);
    270270            if (GlobalTraceMap.ContainsKey(parent)) {
     
    287287          GlobalFragmentMap.Clear();
    288288        }
    289 
    290         #region end of the run (code for writing results to dot files)
    291         //bool maxGenerationsReached = (Generations.Value == MaximumGenerations.Value);
    292         //bool isOsga = (SelectionPressure != null && MaximumSelectionPressure != null);
    293         //bool maxSelectionPressureReached = isOsga && (SelectionPressure.Value >= MaximumSelectionPressure.Value);
    294         //if (maxGenerationsReached || maxSelectionPressureReached) {
    295         //  var path = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
    296 
    297         //  // write whole graph to a dot file
    298         //  WriteDot(path + @"\lineage.dot", graph);
    299 
    300         //  // get genealogy of the best solution
    301         //  var bestSolution = (ISymbolicExpressionTree)qualities.First().Key;
    302         //  var genealogy = graph.GetNode(bestSolution).Ancestors();
    303         //  //WriteDot(path + @"\bestlineage.dot", genealogy);
    304 
    305         //  // write the direct root lineage of the best solution (is it useful?)
    306 
    307         //  // calculate impact values of nodes in the best solution, attempt to trace those with high impact to their origins
    308         //  var calculator = new SymbolicRegressionSolutionValuesCalculator();
    309         //  var impactValues = calculator.CalculateImpactValues(bestSolution, SymbolicExpressionInterpreter, SymbolicRegressionProblemData, 0, 0);
    310         //  foreach (var pair in impactValues.Where(pair => !(pair.Key is ConstantTreeNode || pair.Key is VariableTreeNode)).OrderByDescending(pair => pair.Value).Take(2)) {
    311         //    var node = pair.Key;
    312         //  }
    313         //  //WriteDot(path + @"\impactancestry.dot", genealogy);
    314 
    315         //  // trim the graph
    316         //  // exclude the individuals of the last generation
    317         //  var individuals = graph.Keys.Except(qualities.Select(x => x.Key)).ToList();
    318         //  bool done = false;
    319         //  while (!done) {
    320         //    done = true;
    321         //    foreach (var ind in individuals) {
    322         //      // if node has no outgoing connections (absence of offspring), remove it from the graph
    323         //      var node = graph.GetNode(ind);
    324         //      if (node == null) continue;
    325         //      if (node.OutEdges == null) {
    326         //        done = false; // we still have "dead" nodes
    327         //        graph.RemoveNode(ind);
    328         //      }
    329         //    }
    330         //  }
    331         //  WriteDot(path + @"\trimmedlineage.dot", graph);
    332         //}
    333         #endregion
    334289      }
    335290      return base.Apply();
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeRelativeLengthAnalyzer.cs

    r7997 r8213  
    125125
    126126    [StorableConstructor]
    127     private SymbolicExpressionTreeRelativeLengthAnalyzer(bool deserializing)
     127    protected SymbolicExpressionTreeRelativeLengthAnalyzer(bool deserializing)
    128128      : base() {
    129129    }
    130     private SymbolicExpressionTreeRelativeLengthAnalyzer(SymbolicExpressionTreeRelativeLengthAnalyzer original, Cloner cloner)
     130    protected SymbolicExpressionTreeRelativeLengthAnalyzer(SymbolicExpressionTreeRelativeLengthAnalyzer original, Cloner cloner)
    131131      : base(original, cloner) {
    132132    }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/GenealogyGraph.cs

    r7800 r8213  
    5454    }
    5555
    56     private GenealogyGraph(GenealogyGraph<T> original, Cloner cloner)
     56    protected GenealogyGraph(GenealogyGraph<T> original, Cloner cloner)
    5757      : base(original, cloner) {
    5858      _nodes = new Dictionary<T, GenealogyGraphNode>(original._nodes);
     
    139139      dest.AddReverseArc(src, data2);
    140140    }
    141 
    142     //public void AddArcs(T[] a, T b) {
    143     //  GenealogyGraphNode src, dest;
    144     //  if (!HasNode(b)) {
    145     //    dest = new GenealogyGraphNode(b);
    146     //    _nodes[b] = dest;
    147     //  } else {
    148     //    dest = _nodes[b];
    149     //  }
    150     //  foreach (var o in a) {
    151     //    if (!HasNode(o)) {
    152     //      src = new GenealogyGraphNode(o);
    153     //      _nodes[o] = src;
    154     //    } else {
    155     //      src = _nodes[o];
    156     //    }
    157     //    src.AddForwardArc(dest);
    158     //    dest.AddReverseArc(src);
    159     //  }
    160     //}
    161141  }
    162142
     
    207187    /// <returns>All the ancestors of the current node</returns>
    208188    public IEnumerable<GenealogyGraphNode> Ancestors() {
     189      // for performance, we use a hashset for lookup and a list for iteration
    209190      var nodes = new HashSet<GenealogyGraphNode> { this };
     191      var list = new List<GenealogyGraphNode> { this };
    210192      int i = 0;
    211       while (i != nodes.Count) {
    212         if (nodes.ElementAt(i).InEdges != null) {
    213           foreach (var p in nodes.ElementAt(i).InEdges.Select(e => e.Target)) {
    214             nodes.Add(p);
    215             yield return p;
     193      while (i != list.Count) {
     194        if (list[i].InEdges != null) {
     195          foreach (var e in list[i].InEdges) {
     196            if (nodes.Contains(e.Target)) continue;
     197            nodes.Add(e.Target);
     198            list.Add(e.Target);
    216199          }
    217200        }
    218201        ++i;
    219202      }
     203      return list;
    220204    }
    221205
     
    226210    public IEnumerable<GenealogyGraphNode> Descendants() {
    227211      var nodes = new HashSet<GenealogyGraphNode> { this };
     212      var list = new List<GenealogyGraphNode> { this };
    228213      int i = 0;
    229       while (i != nodes.Count) {
    230         if (nodes.ElementAt(i).OutEdges != null) {
    231           foreach (var p in nodes.ElementAt(i).OutEdges.Select(e => e.Target)) {
    232             nodes.Add(p);
    233             yield return p;
     214      while (i != list.Count) {
     215        if (list[i].OutEdges != null) {
     216          foreach (var e in list[i].OutEdges) {
     217            if (nodes.Contains(e.Target)) continue;
     218            nodes.Add(e.Target);
     219            list.Add(e.Target);
    234220          }
    235221        }
    236222        ++i;
    237223      }
     224      return list;
    238225    }
    239226
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/HeuristicLab.EvolutionaryTracking-3.4.csproj

    r7997 r8213  
    1818    <DebugType>full</DebugType>
    1919    <Optimize>false</Optimize>
    20     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     20    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    2121    <DefineConstants>DEBUG;TRACE</DefineConstants>
    2222    <ErrorReport>prompt</ErrorReport>
     
    2626    <DebugType>pdbonly</DebugType>
    2727    <Optimize>true</Optimize>
    28     <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
     28    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    2929    <DefineConstants>TRACE</DefineConstants>
    3030    <ErrorReport>prompt</ErrorReport>
     
    6969    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    7070    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    71     <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    7271    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
    7372    <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" />
     
    103102      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    104103    </ProjectReference>
     104    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     105      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
     106      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     107    </ProjectReference>
    105108    <ProjectReference Include="..\..\HeuristicLab.Selection\3.3\HeuristicLab.Selection-3.3.csproj">
    106109      <Project>{2C36CD4F-E5F5-43A4-801A-201EA895FE17}</Project>
     
    113116  <ItemGroup>
    114117    <None Include="HeuristicLab.snk" />
    115     <None Include="Plugin.cs.frame" />
    116118  </ItemGroup>
    117119  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Plugin.cs

    r7479 r8213  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    24 using System.Text;
    2522using HeuristicLab.PluginInfrastructure;
    2623
     
    2825  [Plugin("HeuristicLab.EvolutionaryTracking", "Provides operators and related classes for tracking the evolution within a GA.", "3.4.2.7439")]
    2926  [PluginFile("HeuristicLab.EvolutionaryTracking-3.4.dll", PluginFileType.Assembly)]
     27  [PluginDependency("HeuristicLab.Analysis", "3.3")]
    3028  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3129  [PluginDependency("HeuristicLab.Common", "3.3")]
     30  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
    3231  [PluginDependency("HeuristicLab.Core", "3.3")]
    3332  [PluginDependency("HeuristicLab.Data", "3.3")]
     
    3534  [PluginDependency("HeuristicLab.Operators", "3.3")]
    3635  [PluginDependency("HeuristicLab.Optimization", "3.3")]
     36  [PluginDependency("HeuristicLab.Random", "3.3")]
     37  [PluginDependency("HeuristicLab.Selection", "3.3")]
    3738  [PluginDependency("HeuristicLab.Parameters", "3.3")]
    3839  [PluginDependency("HeuristicLab.Persistence", "3.3")]
     40  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]
     41  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
     42  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
     43
    3944  public class HeuristicLabEvolutionaryTrackingPlugin : PluginBase {
    4045  }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Properties

    • Property svn:ignore set to
      AssemblyInfo.cs
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/SymbolicExpressionTreeGenealogyGraph.cs

    r7817 r8213  
    11using System.Collections.Generic;
    22using System.Linq;
     3using HeuristicLab.Common;
    34using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    45using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     6using HeuristicLab.Problems.DataAnalysis.Symbolic;
    57
    68namespace HeuristicLab.EvolutionaryTracking {
     
    1416    }
    1517
     18    public override IDeepCloneable Clone(Cloner cloner) {
     19      return new SymbolicExpressionTreeGenealogyGraph(this, cloner);
     20    }
     21
     22    protected SymbolicExpressionTreeGenealogyGraph(SymbolicExpressionTreeGenealogyGraph original, Cloner cloner)
     23      : base(original, cloner) {
     24    }
     25
    1626    #region Fragment tracing
    1727    public IEnumerable<ISymbolicExpressionTree> TraceFragment(ISymbolicExpressionTreeNode fragment, int mode = 0) {
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic

  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs

    r8126 r8213  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    2627using HeuristicLab.Data;
    2728using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HeuristicLab.Operators;
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    32 using System;
    3332
    3433namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3837  [Item("SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    3938  [StorableClass]
    40   public abstract class SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<T> : SymbolicDataAnalysisSingleObjectiveAnalyzer
    41     where T : class, ISymbolicDataAnalysisSolution {
     39  public abstract class SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> : SymbolicDataAnalysisSingleObjectiveAnalyzer, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
     40    where T : class, ISymbolicDataAnalysisSolution
     41    where S : class, IDataAnalysisProblemData {
     42    private const string ProblemDataParameterName = "ProblemData";
    4243    private const string TrainingBestSolutionsParameterName = "Best training solutions";
    4344    private const string TrainingBestSolutionQualitiesParameterName = "Best training solution qualities";
    4445    private const string ComplexityParameterName = "Complexity";
     46    private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
     47    private const string EstimationLimitsParameterName = "EstimationLimits";
    4548
    4649    public override bool EnabledByDefault {
     
    5861      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[ComplexityParameterName]; }
    5962    }
     63    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
     64      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     65    }
     66    public ILookupParameter<S> ProblemDataParameter {
     67      get { return (ILookupParameter<S>)Parameters[ProblemDataParameterName]; }
     68    }
     69    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
     70      get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
     71    }
    6072    #endregion
    6173    #region properties
     
    7284    [StorableConstructor]
    7385    protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(bool deserializing) : base(deserializing) { }
    74     protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<T> original, Cloner cloner) : base(original, cloner) { }
     86    protected SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer(SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer<S, T> original, Cloner cloner) : base(original, cloner) { }
    7587    public SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer()
    7688      : base() {
     89      Parameters.Add(new LookupParameter<S>(ProblemDataParameterName, "The problem data for the symbolic data analysis solution."));
    7790      Parameters.Add(new LookupParameter<ItemList<T>>(TrainingBestSolutionsParameterName, "The training best (Pareto-optimal) symbolic data analysis solutions."));
    7891      Parameters.Add(new LookupParameter<ItemList<DoubleArray>>(TrainingBestSolutionQualitiesParameterName, "The qualities of the training best (Pareto-optimal) solutions."));
    7992      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(ComplexityParameterName, "The complexity of each tree."));
     93      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
     94      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));
    8095    }
    8196
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs

    r8126 r8213  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    2627using HeuristicLab.Data;
    2728using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    28 using HeuristicLab.Operators;
    2929using HeuristicLab.Optimization;
    3030using HeuristicLab.Parameters;
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    32 using System;
    3332
    3433namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
     
    3837  [Item("SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer", "An operator that analyzes the Pareto-best symbolic data analysis solution for single objective symbolic data analysis problems.")]
    3938  [StorableClass]
    40   public abstract class SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>
     39  public abstract class SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer<S, T, U> : SymbolicDataAnalysisSingleObjectiveValidationAnalyzer<T, U>, ISymbolicDataAnalysisBoundedOperator
    4140    where S : class, ISymbolicDataAnalysisSolution
    4241    where T : class, ISymbolicDataAnalysisSingleObjectiveEvaluator<U>
     
    4544    private const string ValidationBestSolutionQualitiesParameterName = "Best validation solution qualities";
    4645    private const string ComplexityParameterName = "Complexity";
     46    private const string EstimationLimitsParameterName = "EstimationLimits";
    4747
    4848    public override bool EnabledByDefault {
     
    6060      get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters[ComplexityParameterName]; }
    6161    }
     62    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
     63      get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
     64    }
     65
    6266    #endregion
    6367    #region properties
     
    8084      Parameters.Add(new LookupParameter<ItemList<DoubleArray>>(ValidationBestSolutionQualitiesParameterName, "The qualities of the validation best (Pareto-optimal) solutions."));
    8185      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>(ComplexityParameterName, "The complexity of each tree."));
     86      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic classification model."));
    8287    }
    8388
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r7825 r8213  
    4141    <DebugType>full</DebugType>
    4242    <Optimize>false</Optimize>
    43     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     43    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    4444    <DefineConstants>DEBUG;TRACE</DefineConstants>
    4545    <ErrorReport>prompt</ErrorReport>
     
    5050    <DebugType>pdbonly</DebugType>
    5151    <Optimize>true</Optimize>
    52     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     52    <OutputPath>..\..\..\..\Trunk\sources\bin\</OutputPath>
    5353    <DefineConstants>TRACE</DefineConstants>
    5454    <ErrorReport>prompt</ErrorReport>
     
    5858  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    5959    <DebugSymbols>true</DebugSymbols>
    60     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     60    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6161    <DefineConstants>DEBUG;TRACE</DefineConstants>
    6262    <DebugType>full</DebugType>
     
    6666  </PropertyGroup>
    6767  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    68     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     68    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    6969    <DefineConstants>TRACE</DefineConstants>
    7070    <Optimize>true</Optimize>
     
    7676  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    7777    <DebugSymbols>true</DebugSymbols>
    78     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     78    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    7979    <DefineConstants>DEBUG;TRACE</DefineConstants>
    8080    <DebugType>full</DebugType>
     
    8484  </PropertyGroup>
    8585  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    86     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     86    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    8787    <DefineConstants>TRACE</DefineConstants>
    8888    <Optimize>true</Optimize>
     
    9393  </PropertyGroup>
    9494  <ItemGroup>
    95     <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    96       <HintPath>..\..\bin\ALGLIB-3.5.0.dll</HintPath>
    97       <Private>False</Private>
     95    <Reference Include="ALGLIB-3.5.0">
     96      <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.5.0.dll</HintPath>
     97    </Reference>
     98    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     99      <SpecificVersion>False</SpecificVersion>
     100      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     101    </Reference>
     102    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     103      <SpecificVersion>False</SpecificVersion>
     104      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
     105    </Reference>
     106    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     107      <SpecificVersion>False</SpecificVersion>
     108      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     111      <SpecificVersion>False</SpecificVersion>
     112      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Common.Resources-3.3.dll</HintPath>
     113    </Reference>
     114    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     115      <SpecificVersion>False</SpecificVersion>
     116      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
     117    </Reference>
     118    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     119      <SpecificVersion>False</SpecificVersion>
     120      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
     121    </Reference>
     122    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     123      <SpecificVersion>False</SpecificVersion>
     124      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath>
     125    </Reference>
     126    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     127      <SpecificVersion>False</SpecificVersion>
     128      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
     129    </Reference>
     130    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     131      <SpecificVersion>False</SpecificVersion>
     132      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization.Operators-3.3.dll</HintPath>
     133    </Reference>
     134    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     135      <SpecificVersion>False</SpecificVersion>
     136      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Parameters-3.3.dll</HintPath>
     137    </Reference>
     138    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     139      <SpecificVersion>False</SpecificVersion>
     140      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
     141    </Reference>
     142    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     143      <SpecificVersion>False</SpecificVersion>
     144      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
     145    </Reference>
     146    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
     147      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
     148    </Reference>
     149    <Reference Include="HeuristicLab.Problems.Instances-3.3">
     150      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-3.3.dll</HintPath>
     151    </Reference>
     152    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     153      <SpecificVersion>False</SpecificVersion>
     154      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
    98155    </Reference>
    99156    <Reference Include="System" />
     
    113170  <ItemGroup>
    114171    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs" />
    115     <Compile Include="Analyzers\SymbolicDataAnalysisComplexityAnalyzer.cs" />
    116172    <Compile Include="Analyzers\SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs" />
    117173    <Compile Include="Analyzers\SymbolicDataAnalysisMultiObjectiveValidationAnalyzer.cs" />
     
    163219    <Compile Include="SymbolicDataAnalysisExpressionTreeSimplifier.cs" />
    164220    <Compile Include="SymbolicDataAnalysisProblem.cs" />
     221    <Compile Include="SymbolicDataAnalysisSolutionValuesCalculator.cs" />
     222    <Compile Include="SymbolicDataAnalysisExpressionTreeMatching.cs" />
    165223    <Compile Include="Symbols\Addition.cs" />
    166224    <Compile Include="Symbols\And.cs" />
     
    246304  </ItemGroup>
    247305  <ItemGroup>
    248     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    249       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    250       <Name>HeuristicLab.Analysis-3.3</Name>
    251       <Private>False</Private>
    252     </ProjectReference>
    253     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    254       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    255       <Name>HeuristicLab.Collections-3.3</Name>
    256       <Private>False</Private>
    257     </ProjectReference>
    258     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    259       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    260       <Name>HeuristicLab.Common.Resources-3.3</Name>
    261       <Private>False</Private>
    262     </ProjectReference>
    263     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    264       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    265       <Name>HeuristicLab.Common-3.3</Name>
    266       <Private>False</Private>
    267     </ProjectReference>
    268     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    269       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    270       <Name>HeuristicLab.Core-3.3</Name>
    271       <Private>False</Private>
    272     </ProjectReference>
    273     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    274       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    275       <Name>HeuristicLab.Data-3.3</Name>
    276       <Private>False</Private>
    277     </ProjectReference>
    278306    <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    279307      <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    280308      <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    281       <Private>False</Private>
    282     </ProjectReference>
    283     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    284       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    285       <Name>HeuristicLab.Operators-3.3</Name>
    286       <Private>False</Private>
    287     </ProjectReference>
    288     <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
    289       <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
    290       <Name>HeuristicLab.Optimization.Operators-3.3</Name>
    291       <Private>False</Private>
    292     </ProjectReference>
    293     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    294       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    295       <Name>HeuristicLab.Optimization-3.3</Name>
    296     </ProjectReference>
    297     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    298       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    299       <Name>HeuristicLab.Parameters-3.3</Name>
    300       <Private>False</Private>
    301     </ProjectReference>
    302     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    303       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    304       <Name>HeuristicLab.Persistence-3.3</Name>
    305       <Private>False</Private>
    306     </ProjectReference>
    307     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    308       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    309       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    310       <Private>False</Private>
    311     </ProjectReference>
    312     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    313       <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    314       <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    315       <Private>False</Private>
    316     </ProjectReference>
    317     <ProjectReference Include="..\..\HeuristicLab.Problems.Instances\3.3\HeuristicLab.Problems.Instances-3.3.csproj">
    318       <Project>{3540E29E-4793-49E7-8EE2-FEA7F61C3994}</Project>
    319       <Name>HeuristicLab.Problems.Instances-3.3</Name>
    320       <Private>False</Private>
    321     </ProjectReference>
    322     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    323       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    324       <Name>HeuristicLab.Random-3.3</Name>
    325       <Private>False</Private>
    326309    </ProjectReference>
    327310  </ItemGroup>
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisExpressionTreeSimplifier.cs

    r7696 r8213  
    749749        // a is already an addition => append b
    750750        var add = addSymbol.CreateTreeNode();
    751         add.AddSubtree(b);
    752751        foreach (var subtree in a.Subtrees) {
    753752          add.AddSubtree(subtree);
    754753        }
     754        add.AddSubtree(b);
    755755        MergeVariablesInSum(add);
    756756        if (add.Subtrees.Count() == 1) {
     
    897897        }
    898898      }
    899 
    900899      foreach (var unchangedSubtree in unchangedSubtrees)
    901900        prod.AddSubtree(unchangedSubtree);
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r7823 r8213  
    203203      Operators.Add(new SymbolicExpressionSymbolFrequencyAnalyzer());
    204204      Operators.Add(new SymbolicDataAnalysisVariableFrequencyAnalyzer());
    205       Operators.Add(new SymbolicDataAnalysisComplexityAnalyzer());
    206205      Operators.Add(new MinAverageMaxSymbolicExpressionTreeLengthAnalyzer());
    207206      Operators.Add(new SymbolicExpressionTreeLengthAnalyzer());
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection

    • Property svn:ignore set to
      *.user
      bin
      obj
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/Plugin.cs

    r7997 r8213  
    2626  /// Plugin class for HeuristicLab.Selection plugin.
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Selection", "3.3.6.7817")]
     28  [Plugin("HeuristicLab.Selection", "3.3.6.7997")]
    2929  [PluginFile("HeuristicLab.Selection-3.3.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Collections", "3.3")]
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Selection/3.3/Properties

    • Property svn:ignore set to
      AssemblyInfo.cs
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Tracking.sln

    r7779 r8213  
    1515EndProject
    1616Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.EvolutionaryTracking.Views-3.4", "HeuristicLab.EvolutionaryTracking.Views\3.4\HeuristicLab.EvolutionaryTracking.Views-3.4.csproj", "{318DFE8C-CA23-4F1B-A4AC-62B425060241}"
     17EndProject
     18Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj", "{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}"
    1719EndProject
    1820Global
     
    8486    {318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|x64.ActiveCfg = Release|Any CPU
    8587    {318DFE8C-CA23-4F1B-A4AC-62B425060241}.Release|x86.ActiveCfg = Release|Any CPU
     88    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     89    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Any CPU.Build.0 = Debug|Any CPU
     90    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     91    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Mixed Platforms.Build.0 = Debug|x86
     92    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x64.ActiveCfg = Debug|x64
     93    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x64.Build.0 = Debug|x64
     94    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x86.ActiveCfg = Debug|x86
     95    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x86.Build.0 = Debug|x86
     96    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Any CPU.ActiveCfg = Release|Any CPU
     97    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Any CPU.Build.0 = Release|Any CPU
     98    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Mixed Platforms.ActiveCfg = Release|x86
     99    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Mixed Platforms.Build.0 = Release|x86
     100    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x64.ActiveCfg = Release|x64
     101    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x64.Build.0 = Release|x64
     102    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x86.ActiveCfg = Release|x86
     103    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x86.Build.0 = Release|x86
    86104  EndGlobalSection
    87105  GlobalSection(SolutionProperties) = preSolution
Note: See TracChangeset for help on using the changeset viewer.