Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9963


Ignore:
Timestamp:
09/13/13 14:42:38 (11 years ago)
Author:
bburlacu
Message:

#1772: Merged changes from the trunk and other branches. Added new ExtendedSymbolicExpressionTreeCanvas control for the visual exploration of tree genealogies. Reorganized some files and folders.

Location:
branches/HeuristicLab.EvolutionaryTracking
Files:
21 added
3 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.csproj

    r9835 r9963  
    230230      <DependentUpon>SymbolicExpressionView.cs</DependentUpon>
    231231    </Compile>
    232     <Compile Include="TreeLayout.cs" />
    233232    <Compile Include="VisualSymbolicExpressionTreeNode.cs" />
    234233    <Compile Include="VisualSymbolicExpressionTreeNodeConnection.cs" />
     
    267266      <Install>true</Install>
    268267    </BootstrapperPackage>
    269   </ItemGroup>
    270   <ItemGroup>
    271     <EmbeddedResource Include="SymbolicExpressionTreeChart.resx">
    272       <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
    273     </EmbeddedResource>
    274268  </ItemGroup>
    275269  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs

    r9835 r9963  
    2424using System.Drawing;
    2525using System.Drawing.Imaging;
     26using System.IO;
     27using System.Linq;
    2628using System.Windows.Forms;
    2729using Point = System.Drawing.Point;
     
    3335    private Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes;
    3436    private Dictionary<Tuple<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>, VisualSymbolicExpressionTreeNodeConnection> visualLines;
     37    private readonly ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> layoutEngine = new ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> { MinHorizontalSpacing = 5, MinVerticalSpacing = 5 };
     38    private readonly SymbolicExpressionTreeLayoutAdapter layoutAdapter = new SymbolicExpressionTreeLayoutAdapter();
     39
    3540
    3641    public SymbolicExpressionTreeChart() {
     
    160165        graphics.Clear(backgroundColor);
    161166        if (tree != null) {
    162           int height = this.Height / tree.Depth;
    163           DrawFunctionTree(tree, graphics, 0, 0, this.Width, height);
     167          DrawFunctionTree(tree, graphics, 70, 46, 20, 50);
    164168        }
    165169      }
     
    254258    #region methods for painting the symbolic expression tree
    255259
    256     private void DrawFunctionTree(ISymbolicExpressionTree tree, Graphics graphics, int x, int y, int width, int height) {
    257       //      DrawFunctionTree(tree.Root, graphics, x, y, width, height, Point.Empty);
    258       AlternateDraw(tree, graphics, 70, 46, 20, 50);
    259     }
    260 
    261     private void AlternateDraw(ISymbolicExpressionTree tree, Graphics graphics, int preferredWidth, int preferredHeight, int minDistance, int maxDistance) {
    262       var tl = new TreeLayout();
    263       tl.Distance = 5;
    264       tl.SymbolicExpressionTree = tree;
    265 
    266       var nodePositions = tl.GetNodeCoordinates();
    267       var bounds = tl.Bounds();
     260    private void DrawFunctionTree(ISymbolicExpressionTree tree, Graphics graphics, int preferredWidth, int preferredHeight, int minDistance, int maxDistance) {
     261      var layoutNodes = layoutAdapter.Convert(tree).ToList();
     262      layoutEngine.Reset();
     263      layoutEngine.Root = layoutNodes[0];
     264      foreach (var ln in layoutNodes)
     265        layoutEngine.AddNode(ln.Content, ln);
     266      layoutEngine.CalculateLayout();
     267      var nodePositions = layoutEngine.GetNodeCoordinates();
     268      var bounds = layoutEngine.Bounds();
    268269
    269270      double sx = Width / bounds.Width;
    270271      double sy = Height / bounds.Height;
    271272
    272       double dx = tl.Distance * sx; // scaled horizontal distance
    273       double dy = tl.Distance * sy; // scaled vertical distance
     273      double dx = layoutEngine.MinHorizontalSpacing * sx; // scaled horizontal distance
     274      double dy = layoutEngine.MinVerticalSpacing * sy; // scaled vertical distance
    274275
    275276      int maxWidth = (int)Math.Round(dx);
     
    307308            graphics.DrawLine(linePen, origin, target);
    308309          }
    309         }
    310       }
    311     }
    312 
    313     /// <summary>
    314     ///
    315     /// </summary>
    316     /// <param name="node">the root of the function tree to draw</param>
    317     /// <param name="graphics">graphics object to draw on</param>
    318     /// <param name="x">x coordinate of drawing area</param>
    319     /// <param name="y">y coordinate of drawing area</param>
    320     /// <param name="width">width of drawing area</param>
    321     /// <param name="height">height of drawing area</param>
    322     private void DrawFunctionTree(ISymbolicExpressionTreeNode node, Graphics graphics, int x, int y, int width, int height, Point connectionPoint) {
    323       VisualSymbolicExpressionTreeNode visualTreeNode = visualTreeNodes[node];
    324       float center_x = x + width / 2;
    325       float center_y = y + height / 2;
    326       int actualWidth = width - spacing;
    327       int actualHeight = height - spacing;
    328 
    329       using (var textBrush = new SolidBrush(visualTreeNode.TextColor))
    330       using (var nodeLinePen = new Pen(visualTreeNode.LineColor))
    331       using (var nodeFillBrush = new SolidBrush(visualTreeNode.FillColor)) {
    332 
    333         //calculate size of node
    334         if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) {
    335           visualTreeNode.Width = visualTreeNode.PreferredWidth;
    336           visualTreeNode.Height = visualTreeNode.PreferredHeight;
    337           visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2;
    338           visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2;
    339         }
    340           //width too small to draw in desired sized
    341         else if (actualWidth < visualTreeNode.PreferredWidth && actualHeight >= visualTreeNode.PreferredHeight) {
    342           visualTreeNode.Width = actualWidth;
    343           visualTreeNode.Height = visualTreeNode.PreferredHeight;
    344           visualTreeNode.X = x;
    345           visualTreeNode.Y = (int)center_y - visualTreeNode.Height / 2;
    346         }
    347           //height too small to draw in desired sized
    348         else if (actualWidth >= visualTreeNode.PreferredWidth && actualHeight < visualTreeNode.PreferredHeight) {
    349           visualTreeNode.Width = visualTreeNode.PreferredWidth;
    350           visualTreeNode.Height = actualHeight;
    351           visualTreeNode.X = (int)center_x - visualTreeNode.Width / 2;
    352           visualTreeNode.Y = y;
    353         }
    354           //width and height too small to draw in desired size
    355         else {
    356           visualTreeNode.Width = actualWidth;
    357           visualTreeNode.Height = actualHeight;
    358           visualTreeNode.X = x;
    359           visualTreeNode.Y = y;
    360         }
    361 
    362         //draw terminal node
    363         if (node.SubtreeCount == 0) {
    364           graphics.FillRectangle(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
    365           graphics.DrawRectangle(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
    366         } else {
    367           graphics.FillEllipse(nodeFillBrush, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
    368           graphics.DrawEllipse(nodeLinePen, visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height);
    369         }
    370 
    371         //draw name of symbol
    372         var text = node.ToString();
    373         graphics.DrawString(text, textFont, textBrush, new RectangleF(visualTreeNode.X, visualTreeNode.Y, visualTreeNode.Width, visualTreeNode.Height), stringFormat);
    374 
    375         //draw connection line to parent node
    376         if (!connectionPoint.IsEmpty && node.Parent != null) {
    377           var visualLine = GetVisualSymbolicExpressionTreeNodeConnection(node.Parent, node);
    378           using (Pen linePen = new Pen(visualLine.LineColor)) {
    379             linePen.DashStyle = visualLine.DashStyle;
    380             graphics.DrawLine(linePen, connectionPoint, new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y));
    381           }
    382         }
    383 
    384         //calculate areas for the subtrees according to their tree size and call drawFunctionTree
    385         Point connectFrom = new Point(visualTreeNode.X + visualTreeNode.Width / 2, visualTreeNode.Y + visualTreeNode.Height);
    386         int[] xBoundaries = new int[node.SubtreeCount + 1];
    387         xBoundaries[0] = x;
    388         for (int i = 0; i < node.SubtreeCount; i++) {
    389           xBoundaries[i + 1] = (int)(xBoundaries[i] + (width * (double)node.GetSubtree(i).GetLength()) / (node.GetLength() - 1));
    390           DrawFunctionTree(node.GetSubtree(i), graphics, xBoundaries[i], y + height, xBoundaries[i + 1] - xBoundaries[i], height, connectFrom);
    391310        }
    392311      }
     
    455374    }
    456375    #endregion
     376    #region export pgf/tikz
     377    private void exportLatexToolStripMenuItem_Click(object sender, EventArgs e) {
     378      using (var dialog = new SaveFileDialog { Filter = "Tex (*.tex)|*.tex" }) {
     379        if (dialog.ShowDialog() != DialogResult.OK) return;
     380        string filename = dialog.FileName.ToLower();
     381        var formatter = new SymbolicExpressionTreeLatexFormatter();
     382        File.WriteAllText(filename, formatter.Format(Tree));
     383      }
     384    }
     385    #endregion
    457386  }
    458387}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj

    r9835 r9963  
    191191    <Compile Include="Crossovers\TracingSymbolicExpressionTreeCrossover.cs" />
    192192    <Compile Include="Formatters\SymbolicExpressionTreeGraphvizFormatter.cs" />
     193    <Compile Include="Formatters\SymbolicExpressionTreeLatexFormatter.cs" />
    193194    <Compile Include="Fragment.cs" />
    194195    <Compile Include="GenericWrapper.cs" />
    195196    <Compile Include="GeneticExchange.cs" />
    196197    <Compile Include="Interfaces\IFragment.cs" />
     198    <Compile Include="Interfaces\ILayoutAdapter.cs" />
     199    <Compile Include="Interfaces\ILayoutNode.cs" />
    197200    <Compile Include="Interfaces\IReadOnlySymbol.cs" />
    198201    <Compile Include="Interfaces\ISymbolicExpressionGrammar.cs" />
     
    217220    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeSizeConstraintOperator.cs" />
    218221    <Compile Include="Interfaces\Operators\ITracingSymbolicExpressionTreeOperator.cs" />
     222    <Compile Include="LayoutEngines\LayoutNode.cs" />
     223    <Compile Include="LayoutEngines\ReingoldTilfordLayoutEngine.cs" />
     224    <Compile Include="LayoutEngines\SymbolicExpressionTreeLayoutAdapter.cs" />
    219225    <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" />
    220226    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeManipulator.cs" />
     
    240246    <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeOperator.cs" />
    241247    <Compile Include="SymbolicExpressionTree.cs" />
    242     <Compile Include="Properties\AssemblyInfo.cs" />
    243248    <Compile Include="SymbolicExpressionTreeNode.cs" />
    244249    <Compile Include="Symbols\Argument.cs" />
     
    258263    <None Include="Plugin.cs.frame" />
    259264    <None Include="Properties\AssemblyInfo.cs.frame" />
     265    <Compile Include="Properties\AssemblyInfo.cs" />
    260266  </ItemGroup>
    261267  <ItemGroup>
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs

    r9835 r9963  
    111111        if (layers[i].Rank.IsAlmost(rank)) {
    112112          var visualTextNode = new VisualGenealogyGraphTextLabel(Chart, x, y + 2, x + Diameter, y + Diameter) {
    113             Brush = new SolidBrush(Color.Black),
     113            FontBrush = new SolidBrush(Color.Black),
    114114            Font = new Font("Arial", Diameter - 4, FontStyle.Regular, GraphicsUnit.Pixel),
    115115            Text = String.Format("{0:0}", rank)
     
    154154      }
    155155      // add arcs separately (to avoid some ordering problems)
    156       foreach (SymbolicExpressionGenealogyGraphNode node in Graph.Nodes) {
     156      foreach (SymbolicExpressionTreeGenealogyGraphNode node in Graph.Nodes) {
    157157        VisualGenealogyGraphNode visualNode = GetVisualGenealogyGraphNode(node);
    158158        if (node.InEdges == null) continue;
     
    171171
    172172      //        var brush = new SolidBrush(Color.BlueViolet);
    173       //        visualGraphNode.Brush = brush;
     173      //        visualGraphNode.FontBrush = brush;
    174174      //      }
    175175
     
    267267        arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor());
    268268        arc.Pen.Color = Color.Transparent;
    269         //        arc.Pen.Brush = new SolidBrush(Color.DarkGray);
     269        //        arc.Pen.FontBrush = new SolidBrush(Color.DarkGray);
    270270        DrawLineage(nodeSelector(arc), arcSelector, nodeSelector);
    271271      }
     
    300300    }
    301301
    302     public void HighlightNodes(IEnumerable<SymbolicExpressionGenealogyGraphNode> nodes) {
     302    public void HighlightNodes(IEnumerable<SymbolicExpressionTreeGenealogyGraphNode> nodes) {
    303303      Chart.UpdateEnabled = false;
    304304      ClearAllNodes();
     
    333333    }
    334334
    335     public void HighlightNode(SymbolicExpressionGenealogyGraphNode graphNode, Color color) {
     335    public void HighlightNode(SymbolicExpressionTreeGenealogyGraphNode graphNode, Color color) {
    336336      GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(color);
    337337    }
     
    388388
    389389  internal static class Util {
    390     public static Color GetColor(this SymbolicExpressionGenealogyGraphNode node) {
     390    public static Color GetColor(this SymbolicExpressionTreeGenealogyGraphNode node) {
    391391      var colorIndex = (int)(node.Quality * ColorGradient.Colors.Count);
    392392      if (colorIndex >= ColorGradient.Colors.Count) --colorIndex;
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs

    r9835 r9963  
    231231
    232232    private void highlightRootParentsButton_Click(object sender, EventArgs e) {
    233       var nodes = genealogyGraphChart.Graph.Nodes.Where(n => n.InEdges != null && n.InEdges.Count == 2).Select(n => (SymbolicExpressionGenealogyGraphNode)n.InEdges[0].Source).ToList();
     233      var nodes = genealogyGraphChart.Graph.Nodes.Where(n => n.InEdges != null && n.InEdges.Count == 2).Select(n => (SymbolicExpressionTreeGenealogyGraphNode)n.InEdges[0].Source).ToList();
    234234      genealogyGraphChart.HighlightNodes(nodes);
    235235    }
    236236
    237237    private void highlightSecondaryParentsButton_Click(object sender, EventArgs e) {
    238       var nodes = genealogyGraphChart.Graph.Nodes.Where(n => n.InEdges != null && n.InEdges.Count == 2).Select(n => (SymbolicExpressionGenealogyGraphNode)n.InEdges[1].Source).ToList();
     238      var nodes = genealogyGraphChart.Graph.Nodes.Where(n => n.InEdges != null && n.InEdges.Count == 2).Select(n => (SymbolicExpressionTreeGenealogyGraphNode)n.InEdges[1].Source).ToList();
    239239      genealogyGraphChart.HighlightNodes(nodes);
    240240    }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj

    r9835 r9963  
    109109  </ItemGroup>
    110110  <ItemGroup>
     111    <Compile Include="AncestryLayoutAdapter.cs" />
     112    <Compile Include="ExtendedSymbolicExpressionTreeCanvas.cs">
     113      <SubType>UserControl</SubType>
     114    </Compile>
    111115    <Compile Include="FrequentFragmentsDialog.cs">
    112116      <SubType>Form</SubType>
     
    133137      <DependentUpon>GenealogyGraphView.cs</DependentUpon>
    134138    </Compile>
    135     <Compile Include="Karyogram.cs">
    136       <SubType>UserControl</SubType>
    137     </Compile>
    138     <Compile Include="Karyogram.Designer.cs">
    139       <DependentUpon>Karyogram.cs</DependentUpon>
    140     </Compile>
    141139    <Compile Include="LineageExplorerView.cs">
    142140      <SubType>UserControl</SubType>
     
    146144    </Compile>
    147145    <Compile Include="Plugin.cs" />
     146    <Compile Include="Primitives\LabeledEllipse.cs" />
     147    <Compile Include="Primitives\LabeledRectangle.cs" />
     148    <Compile Include="Primitives\PrimitiveGroup.cs" />
    148149    <Compile Include="Properties\AssemblyInfo.cs" />
    149150    <Compile Include="Properties\Resources.Designer.cs">
     
    182183  </ItemGroup>
    183184  <ItemGroup>
    184     <EmbeddedResource Include="FrequentFragmentsDialog.resx">
    185       <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon>
    186     </EmbeddedResource>
    187     <EmbeddedResource Include="GenealogyGraphDialog.resx">
    188       <DependentUpon>GenealogyGraphDialog.cs</DependentUpon>
    189     </EmbeddedResource>
    190     <EmbeddedResource Include="GenealogyGraphView.resx">
    191       <DependentUpon>GenealogyGraphView.cs</DependentUpon>
    192     </EmbeddedResource>
    193     <EmbeddedResource Include="LineageExplorerView.resx">
    194       <DependentUpon>LineageExplorerView.cs</DependentUpon>
    195     </EmbeddedResource>
    196185    <EmbeddedResource Include="Properties\Resources.resx">
    197186      <Generator>ResXFileCodeGenerator</Generator>
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.Designer.cs

    r9835 r9963  
    4444      this.consideredTrees = new System.Windows.Forms.Label();
    4545      this.tabPage3 = new System.Windows.Forms.TabPage();
    46       this.karyograph1 = new HeuristicLab.EvolutionaryTracking.Views.Karyogram();
    4746      this.karyographTab.SuspendLayout();
    4847      this.tabPage1.SuspendLayout();
     
    9190      // qualityImprovementTreeView
    9291      //
    93       this.qualityImprovementTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
     92      this.qualityImprovementTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    9493            | System.Windows.Forms.AnchorStyles.Right)));
    9594      this.qualityImprovementTreeView.HideSelection = false;
     
    102101      // symbolicExpressionTreeChart
    103102      //
    104       this.symbolicExpressionTreeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    105             | System.Windows.Forms.AnchorStyles.Left) 
     103      this.symbolicExpressionTreeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     104            | System.Windows.Forms.AnchorStyles.Left)
    106105            | System.Windows.Forms.AnchorStyles.Right)));
    107106      this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White;
     
    250249      // tabPage3
    251250      //
    252       this.tabPage3.Controls.Add(this.karyograph1);
    253251      this.tabPage3.Location = new System.Drawing.Point(4, 22);
    254252      this.tabPage3.Name = "tabPage3";
     
    258256      this.tabPage3.Text = "Karyograph";
    259257      this.tabPage3.UseVisualStyleBackColor = true;
    260       //
    261       // karyograph1
    262       //
    263       this.karyograph1.BackColor = System.Drawing.SystemColors.Control;
    264       this.karyograph1.Chart = null;
    265       this.karyograph1.Dock = System.Windows.Forms.DockStyle.Fill;
    266       this.karyograph1.Location = new System.Drawing.Point(3, 3);
    267       this.karyograph1.Name = "karyograph1";
    268       this.karyograph1.ScaleOnResize = true;
    269       this.karyograph1.Size = new System.Drawing.Size(1002, 637);
    270       this.karyograph1.TabIndex = 0;
    271258      //
    272259      // LineageExplorerView
     
    311298    private System.Windows.Forms.Panel panel4;
    312299    private System.Windows.Forms.TabPage tabPage3;
    313     private Karyogram karyograph1;
    314 
    315 
    316 
    317 
    318 
    319 
    320 
    321300  }
    322301}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.cs

    r9835 r9963  
    1616  public sealed partial class LineageExplorerView : ItemView {
    1717    private Dictionary<TreeNode, ISymbolicExpressionTree> treeMap;
    18     private List<SymbolicExpressionGenealogyGraphNode> lineage;
     18    private List<SymbolicExpressionTreeGenealogyGraphNode> lineage;
    1919
    2020    private Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>> fragmentFrequencies;
     
    5959        }
    6060      }
    61 
    62       karyograph1.Trees = Content.Trees.OrderByDescending(x => x.Item2).Select(x => x.Item1).ToList();
    6361    }
    6462
     
    9492
    9593      var graphNode = Content.GenealogyGraph.GetGraphNodes(symbExprTree).Last();
    96       lineage = lineage ?? new List<SymbolicExpressionGenealogyGraphNode>();
     94      lineage = lineage ?? new List<SymbolicExpressionTreeGenealogyGraphNode>();
    9795      lineage.Clear();
    9896      lineage.Add(graphNode);
     
    10098      var gn = graphNode;
    10199      while (gn.InEdges != null && gn.InEdges.Count != 0) {
    102         gn = (SymbolicExpressionGenealogyGraphNode)gn.InEdges[0].Source;
     100        gn = (SymbolicExpressionTreeGenealogyGraphNode)gn.InEdges[0].Source;
    103101        lineage.Add(gn);
    104102      }
     
    127125      symbolicExpressionTreeChart.Tree = symbExprTree;
    128126      var matchingNodes = Content.GenealogyGraph.GetGraphNodes(symbExprTree);
    129       SymbolicExpressionGenealogyGraphNode graphNode = matchingNodes.First();
     127      SymbolicExpressionTreeGenealogyGraphNode graphNode = matchingNodes.First();
    130128      if (graphNode.InEdges == null) {
    131129        symbolicExpressionTreeChart.SuspendRepaint = false;
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs

    r9420 r9963  
    2727namespace HeuristicLab.EvolutionaryTracking.Views {
    2828  public class VisualGenealogyGraphNode : Ellipse {
    29     public SymbolicExpressionGenealogyGraphNode Data { get; internal set; }
     29    public SymbolicExpressionTreeGenealogyGraphNode Data { get; internal set; }
    3030    private List<VisualGenealogyGraphArc> incomingArcs = new List<VisualGenealogyGraphArc>();
    3131    private List<VisualGenealogyGraphArc> outgoingArcs = new List<VisualGenealogyGraphArc>();
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphTextLabel.cs

    r9420 r9963  
    1 using System;
    2 using System.Drawing;
     1using System.Drawing;
    32using HeuristicLab.Visualization;
    43using Rectangle = HeuristicLab.Visualization.Rectangle;
     
    1211    public Font Font { get { return font; } set { font = value; } }
    1312
    14     private Brush brush;
    15     public Brush Brush { get { return brush; } set { brush = value; } }
     13    private Brush fontBrush;
     14    public Brush FontBrush { get { return fontBrush; } set { fontBrush = value; } }
    1615
    1716    public VisualGenealogyGraphTextLabel(IChart chart, PointD lowerLeft, PointD upperRight)
     
    3433      float fontSize = s.Height;
    3534      font = new Font(font.Name, fontSize, Font.Style, GraphicsUnit.Pixel);
    36       graphics.DrawString(text, font, brush, p.X, p.Y);
     35      graphics.DrawString(text, font, fontBrush, p.X, p.Y);
    3736    }
    3837
    39     public EventHandler Update;
    40     protected virtual void OnUpdate() {
    41       if ((UpdateEnabled) && (Update != null)) {
    42         Update(this, new EventArgs());
     38    protected override void OnUpdate() {
     39      if ((UpdateEnabled)) {
     40        base.OnUpdate();
    4341      }
    44       base.OnUpdate();
    4542    }
    4643  }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeEvolvabilityAnalyzer.cs

    r9835 r9963  
    159159                               where graphNode.InEdges.Count == 1
    160160                               // mutation
    161                                let source = (SymbolicExpressionGenealogyGraphNode)graphNode.InEdges[0].Source
     161                               let source = (SymbolicExpressionTreeGenealogyGraphNode)graphNode.InEdges[0].Source
    162162                               where graphNode.SymbolicExpressionTree != source.SymbolicExpressionTree // skip elites
    163163                               select source).ToList();
     
    177177          switch (graphNode.InEdges.Count) {
    178178            case 2: {
    179                 parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpressionGenealogyGraphNode)e.Source).Quality);
     179                parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpressionTreeGenealogyGraphNode)e.Source).Quality);
    180180                crossoverImprovements.Add(quality - parentQuality);
    181181                break;
    182182              }
    183183            case 1: {
    184                 parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpressionGenealogyGraphNode)e.Source).Quality);
     184                parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpressionTreeGenealogyGraphNode)e.Source).Quality);
    185185                if (ConstantOptimizationIntermediateParents.Value && ConstantOptimizationEvaluator != null) {
    186186
    187187                  //Get the optimized fitness of the intermediate parent (without actually updating the constants in the tree)
    188                   var intermediateParent = ((SymbolicExpressionGenealogyGraphNode)graphNode.InEdges[0].Source).SymbolicExpressionTree;
     188                  var intermediateParent = ((SymbolicExpressionTreeGenealogyGraphNode)graphNode.InEdges[0].Source).SymbolicExpressionTree;
    189189                  parentQuality = Evaluate(intermediateParent, ConstantOptimizationEvaluator);
    190190                }
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/HeuristicLab.EvolutionaryTracking-3.4.csproj

    r9835 r9963  
    131131  </ItemGroup>
    132132  <ItemGroup>
    133     <Compile Include="Analyzers\BuildingBlocks\BuildingBlockHistoryAnalyzer.cs" />
    134133    <Compile Include="Analyzers\BuildingBlocks\RelevantBuildingBlocksAnalyzer.cs" />
    135134    <Compile Include="Analyzers\BuildingBlocks\Poly10BuildingBlocksAnalyzer.cs" />
    136     <Compile Include="Analyzers\LineageRetrofittingAnalyzer.cs" />
    137135    <Compile Include="Analyzers\SymbolicExpressionTreePruningAnalyzer.cs" />
    138136    <Compile Include="Analyzers\SymbolicExpressionTreeShapeAnalyzer.cs" />
     
    162160    <Compile Include="Properties\AssemblyInfo.cs" />
    163161    <Compile Include="SymbolGraph.cs" />
    164     <Compile Include="SymbolicExpressionTreeGenealogyGraph.cs" />
     162    <Compile Include="SymbolicExpressionTreeGenealogyGraph\SymbolicExpressionTreeGenealogyGraph.cs" />
     163    <Compile Include="SymbolicExpressionTreeGenealogyGraph\SymbolicExpressionTreeGenealogyGraphNode.cs" />
    165164  </ItemGroup>
    166165  <ItemGroup />
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Interfaces/ISymbolicExpressionTreeGenealogyGraph.cs

    r9419 r9963  
    2424
    2525namespace HeuristicLab.EvolutionaryTracking {
    26   public interface ISymbolicExpressionTreeGenealogyGraph : IGenericGraph<SymbolicExpressionGenealogyGraphNode> {
    27     List<SymbolicExpressionGenealogyGraphNode> GetGraphNodes(ISymbolicExpressionTree tree);
     26  public interface ISymbolicExpressionTreeGenealogyGraph : IGenericGraph<SymbolicExpressionTreeGenealogyGraphNode> {
     27    List<SymbolicExpressionTreeGenealogyGraphNode> GetGraphNodes(ISymbolicExpressionTree tree);
    2828  }
    2929}
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Operators/SymbolicExpressionTreeGenealogyGraphBuilder.cs

    r9835 r9963  
    214214          var tree = pair.Tree;
    215215          var quality = pair.Quality;
    216           graph.AddNode(new SymbolicExpressionGenealogyGraphNode {
     216          graph.AddNode(new SymbolicExpressionTreeGenealogyGraphNode {
    217217            SymbolicExpressionTree = tree,
    218218            Quality = quality,
     
    226226                        let tree = pairs[i].Tree
    227227                        let quality = pairs[i].Quality
    228                         select new SymbolicExpressionGenealogyGraphNode {
     228                        select new SymbolicExpressionTreeGenealogyGraphNode {
    229229                          SymbolicExpressionTree = tree,
    230230                          Quality = quality,
     
    240240         // 1 parent means mutation
    241241         let p = (ISymbolicExpressionTree)parents[0]
    242          select new SymbolicExpressionGenealogyGraphNode {
     242         select new SymbolicExpressionTreeGenealogyGraphNode {
    243243           SymbolicExpressionTree = p,
    244244           Quality = Evaluate(p),
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj

    r9835 r9963  
    390390    </BootstrapperPackage>
    391391  </ItemGroup>
    392   <ItemGroup>
    393     <EmbeddedResource Include="RunCollectionViews\RunCollectionDataTableView.resx">
    394       <DependentUpon>RunCollectionDataTableView.cs</DependentUpon>
    395     </EmbeddedResource>
    396   </ItemGroup>
    397392  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    398393  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r9835 r9963  
    240240    <Compile Include="SymbolicDataAnalysisProblem.cs" />
    241241    <Compile Include="SymbolicDataAnalysisSolutionImpactValuesCalculator.cs" />
     242    <Compile Include="SymbolicDataAnalysisSolutionPruningOptimizer.cs" />
    242243    <Compile Include="SymbolicDataAnalysisSolutionTextRenderer.cs" />
    243244    <Compile Include="Symbols\Addition.cs" />
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowData.cs

    r9162 r9963  
    6161      : base(original, cloner) {
    6262      slidingWindowPosition = cloner.Clone(original.slidingWindowPosition);
    63       targetValues = new List<double>(original.targetValues);
     63      if (original.targetValues != null)
     64        targetValues = new List<double>(original.targetValues);
     65      if (original.estimatedValues != null)
     66        estimatedValues = new List<double>(original.estimatedValues);
    6467    }
    6568    public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset for help on using the changeset viewer.