Changeset 3244
- Timestamp:
- 03/31/10 18:34:34 (15 years ago)
- 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 82 82 </ItemGroup> 83 83 <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> 84 90 <Compile Include="HeuristicLabEncodingsSymbolicExpressionTreeEncodingViewsPlugin.cs" /> 85 91 <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"> 87 98 <SubType>UserControl</SubType> 88 99 </Compile> 89 <Compile Include="SymbolicExpressionTree View.Designer.cs">90 <DependentUpon>SymbolicExpressionTree View.cs</DependentUpon>100 <Compile Include="SymbolicExpressionTreeChart.Designer.cs"> 101 <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon> 91 102 </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" /> 92 110 </ItemGroup> 93 111 <ItemGroup> … … 118 136 <None Include="Properties\AssemblyInfo.frame" /> 119 137 </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> 120 150 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 121 151 <!-- 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 1 1 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { 2 partial class SymbolicExpression TreeView {2 partial class SymbolicExpressionView { 3 3 /// <summary> 4 4 /// Required designer variable. -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionView.cs
r3242 r3244 11 11 12 12 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { 13 [View("SymbolicExpression TreeView")]14 [Content(typeof(SymbolicExpressionTree), true)]15 public partial class SymbolicExpression TreeView : AsynchronousContentView {13 [View("SymbolicExpression View")] 14 [Content(typeof(SymbolicExpressionTree), false)] 15 public partial class SymbolicExpressionView : AsynchronousContentView { 16 16 public new SymbolicExpressionTree Content { 17 17 get { return (SymbolicExpressionTree)base.Content; } … … 19 19 } 20 20 21 public SymbolicExpression TreeView() {21 public SymbolicExpressionView() { 22 22 InitializeComponent(); 23 Caption = "SymbolicExpression TreeView";23 Caption = "SymbolicExpression View"; 24 24 } 25 25 26 public SymbolicExpression TreeView(SymbolicExpressionTree content)26 public SymbolicExpressionView(SymbolicExpressionTree content) 27 27 : this() { 28 28 Content = content; … … 33 33 base.OnContentChanged(); 34 34 if (Content == null) { 35 Caption = "SymbolicExpression TreeView";35 Caption = "SymbolicExpression View"; 36 36 textBox.Text = string.Empty; 37 37 textBox.Enabled = false; -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTree.cs
r3237 r3244 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-20 08Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Linq; 23 24 using System.Collections.Generic; 24 25 using System.Text; … … 60 61 public SymbolicExpressionTree(SymbolicExpressionTreeNode root) : base() { } 61 62 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 62 84 public override IDeepCloneable Clone(Cloner cloner) { 63 85 SymbolicExpressionTree clone = new SymbolicExpressionTree(); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.3/SymbolicExpressionTreeNode.cs
r3237 r3244 26 26 using System.Xml; 27 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Data; 28 29 29 30 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 49 50 //} 50 51 51 internalvirtual bool HasLocalParameters {52 public virtual bool HasLocalParameters { 52 53 get { return false; } 53 54 } … … 62 63 } 63 64 64 internalint GetSize() {65 public int GetSize() { 65 66 int size = 1; 66 67 foreach (SymbolicExpressionTreeNode tree in SubTrees) size += tree.GetSize(); … … 68 69 } 69 70 70 internalint GetHeight() {71 public int GetHeight() { 71 72 int maxHeight = 0; 72 73 foreach (SymbolicExpressionTreeNode tree in SubTrees) maxHeight = Math.Max(maxHeight, tree.GetHeight());
Note: See TracChangeset
for help on using the changeset viewer.