Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3244


Ignore:
Timestamp:
03/31/10 18:34:34 (14 years ago)
Author:
gkronber
Message:

Integrated graphical symbolic expression tree view from model analyzer. #937 (Data types and operators for symbolic expression tree encoding)

Location:
trunk/sources
Files:
9 added
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.3.csproj

    r3242 r3244  
    8282  </ItemGroup>
    8383  <ItemGroup>
     84    <Compile Include="GraphicalSymbolicExpressionTreeView.cs">
     85      <SubType>UserControl</SubType>
     86    </Compile>
     87    <Compile Include="GraphicalSymbolicExpressionTreeView.Designer.cs">
     88      <DependentUpon>GraphicalSymbolicExpressionTreeView.cs</DependentUpon>
     89    </Compile>
    8490    <Compile Include="HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs" />
    8591    <Compile Include="Properties\AssemblyInfo.cs" />
    86     <Compile Include="SymbolicExpressionTreeView.cs">
     92    <Compile Include="Properties\Resources.Designer.cs">
     93      <AutoGen>True</AutoGen>
     94      <DesignTime>True</DesignTime>
     95      <DependentUpon>Resources.resx</DependentUpon>
     96    </Compile>
     97    <Compile Include="SymbolicExpressionTreeChart.cs">
    8798      <SubType>UserControl</SubType>
    8899    </Compile>
    89     <Compile Include="SymbolicExpressionTreeView.Designer.cs">
    90       <DependentUpon>SymbolicExpressionTreeView.cs</DependentUpon>
     100    <Compile Include="SymbolicExpressionTreeChart.Designer.cs">
     101      <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
    91102    </Compile>
     103    <Compile Include="SymbolicExpressionView.cs">
     104      <SubType>UserControl</SubType>
     105    </Compile>
     106    <Compile Include="SymbolicExpressionView.Designer.cs">
     107      <DependentUpon>SymbolicExpressionView.cs</DependentUpon>
     108    </Compile>
     109    <Compile Include="VisualSymbolicExpressionTreeNode.cs" />
    92110  </ItemGroup>
    93111  <ItemGroup>
     
    118136    <None Include="Properties\AssemblyInfo.frame" />
    119137  </ItemGroup>
     138  <ItemGroup>
     139    <EmbeddedResource Include="GraphicalSymbolicExpressionTreeView.resx">
     140      <DependentUpon>GraphicalSymbolicExpressionTreeView.cs</DependentUpon>
     141    </EmbeddedResource>
     142    <EmbeddedResource Include="Properties\Resources.resx">
     143      <Generator>ResXFileCodeGenerator</Generator>
     144      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     145    </EmbeddedResource>
     146    <EmbeddedResource Include="SymbolicExpressionTreeChart.resx">
     147      <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>
     148    </EmbeddedResource>
     149  </ItemGroup>
    120150  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    121151  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.Designer.cs

    r3242 r3244  
    11namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
    2   partial class SymbolicExpressionTreeView {
     2  partial class SymbolicExpressionView {
    33    /// <summary>
    44    /// Required designer variable.
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.cs

    r3242 r3244  
    1111
    1212namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views {
    13   [View("SymbolicExpressionTree View")]
    14   [Content(typeof(SymbolicExpressionTree), true)]
    15   public partial class SymbolicExpressionTreeView : AsynchronousContentView {
     13  [View("SymbolicExpression View")]
     14  [Content(typeof(SymbolicExpressionTree), false)]
     15  public partial class SymbolicExpressionView : AsynchronousContentView {
    1616    public new SymbolicExpressionTree Content {
    1717      get { return (SymbolicExpressionTree)base.Content; }
     
    1919    }
    2020
    21     public SymbolicExpressionTreeView() {
     21    public SymbolicExpressionView() {
    2222      InitializeComponent();
    23       Caption = "SymbolicExpressionTree View";
     23      Caption = "SymbolicExpression View";
    2424    }
    2525
    26     public SymbolicExpressionTreeView(SymbolicExpressionTree content)
     26    public SymbolicExpressionView(SymbolicExpressionTree content)
    2727      : this() {
    2828      Content = content;
     
    3333      base.OnContentChanged();
    3434      if (Content == null) {
    35         Caption = "SymbolicExpressionTree View";
     35        Caption = "SymbolicExpression View";
    3636        textBox.Text = string.Empty;
    3737        textBox.Enabled = false;
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs

    r3237 r3244  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
     23using System.Linq;
    2324using System.Collections.Generic;
    2425using System.Text;
     
    6061    public SymbolicExpressionTree(SymbolicExpressionTreeNode root) : base() { }
    6162
     63    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix() {
     64      return IterateNodesPrefix(root);
     65    }
     66    private IEnumerable<SymbolicExpressionTreeNode> IterateNodesPrefix(SymbolicExpressionTreeNode node) {
     67      yield return node;
     68      foreach (var subtree in node.SubTrees) {
     69        foreach (var n in IterateNodesPrefix(subtree))
     70          yield return n;
     71      }
     72    }
     73    public IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix() {
     74      return IterateNodesPostfix(root);
     75    }
     76    private IEnumerable<SymbolicExpressionTreeNode> IterateNodesPostfix(SymbolicExpressionTreeNode node) {
     77      foreach (var subtree in node.SubTrees) {
     78        foreach (var n in IterateNodesPrefix(subtree))
     79          yield return n;
     80      }
     81      yield return node;
     82    }
     83
    6284    public override IDeepCloneable Clone(Cloner cloner) {
    6385      SymbolicExpressionTree clone = new SymbolicExpressionTree();
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs

    r3237 r3244  
    2626using System.Xml;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Data;
    2829
    2930namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     
    4950    //}
    5051
    51     internal virtual bool HasLocalParameters {
     52    public virtual bool HasLocalParameters {
    5253      get { return false; }
    5354    }
     
    6263    }
    6364
    64     internal int GetSize() {
     65    public int GetSize() {
    6566      int size = 1;
    6667      foreach (SymbolicExpressionTreeNode tree in SubTrees) size += tree.GetSize();
     
    6869    }
    6970
    70     internal int GetHeight() {
     71    public int GetHeight() {
    7172      int maxHeight = 0;
    7273      foreach (SymbolicExpressionTreeNode tree in SubTrees) maxHeight = Math.Max(maxHeight, tree.GetHeight());
Note: See TracChangeset for help on using the changeset viewer.