Changeset 9963
- Timestamp:
- 09/13/13 14:42:38 (11 years ago)
- 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 230 230 <DependentUpon>SymbolicExpressionView.cs</DependentUpon> 231 231 </Compile> 232 <Compile Include="TreeLayout.cs" />233 232 <Compile Include="VisualSymbolicExpressionTreeNode.cs" /> 234 233 <Compile Include="VisualSymbolicExpressionTreeNodeConnection.cs" /> … … 267 266 <Install>true</Install> 268 267 </BootstrapperPackage> 269 </ItemGroup>270 <ItemGroup>271 <EmbeddedResource Include="SymbolicExpressionTreeChart.resx">272 <DependentUpon>SymbolicExpressionTreeChart.cs</DependentUpon>273 </EmbeddedResource>274 268 </ItemGroup> 275 269 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs
r9835 r9963 24 24 using System.Drawing; 25 25 using System.Drawing.Imaging; 26 using System.IO; 27 using System.Linq; 26 28 using System.Windows.Forms; 27 29 using Point = System.Drawing.Point; … … 33 35 private Dictionary<ISymbolicExpressionTreeNode, VisualSymbolicExpressionTreeNode> visualTreeNodes; 34 36 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 35 40 36 41 public SymbolicExpressionTreeChart() { … … 160 165 graphics.Clear(backgroundColor); 161 166 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); 164 168 } 165 169 } … … 254 258 #region methods for painting the symbolic expression tree 255 259 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(); 268 269 269 270 double sx = Width / bounds.Width; 270 271 double sy = Height / bounds.Height; 271 272 272 double dx = tl.Distance* sx; // scaled horizontal distance273 double dy = tl.Distance* sy; // scaled vertical distance273 double dx = layoutEngine.MinHorizontalSpacing * sx; // scaled horizontal distance 274 double dy = layoutEngine.MinVerticalSpacing * sy; // scaled vertical distance 274 275 275 276 int maxWidth = (int)Math.Round(dx); … … 307 308 graphics.DrawLine(linePen, origin, target); 308 309 } 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 node334 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 sized341 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 sized348 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 size355 else {356 visualTreeNode.Width = actualWidth;357 visualTreeNode.Height = actualHeight;358 visualTreeNode.X = x;359 visualTreeNode.Y = y;360 }361 362 //draw terminal node363 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 symbol372 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 node376 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 drawFunctionTree385 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);391 310 } 392 311 } … … 455 374 } 456 375 #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 457 386 } 458 387 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
r9835 r9963 191 191 <Compile Include="Crossovers\TracingSymbolicExpressionTreeCrossover.cs" /> 192 192 <Compile Include="Formatters\SymbolicExpressionTreeGraphvizFormatter.cs" /> 193 <Compile Include="Formatters\SymbolicExpressionTreeLatexFormatter.cs" /> 193 194 <Compile Include="Fragment.cs" /> 194 195 <Compile Include="GenericWrapper.cs" /> 195 196 <Compile Include="GeneticExchange.cs" /> 196 197 <Compile Include="Interfaces\IFragment.cs" /> 198 <Compile Include="Interfaces\ILayoutAdapter.cs" /> 199 <Compile Include="Interfaces\ILayoutNode.cs" /> 197 200 <Compile Include="Interfaces\IReadOnlySymbol.cs" /> 198 201 <Compile Include="Interfaces\ISymbolicExpressionGrammar.cs" /> … … 217 220 <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeSizeConstraintOperator.cs" /> 218 221 <Compile Include="Interfaces\Operators\ITracingSymbolicExpressionTreeOperator.cs" /> 222 <Compile Include="LayoutEngines\LayoutNode.cs" /> 223 <Compile Include="LayoutEngines\ReingoldTilfordLayoutEngine.cs" /> 224 <Compile Include="LayoutEngines\SymbolicExpressionTreeLayoutAdapter.cs" /> 219 225 <Compile Include="Manipulators\ChangeNodeTypeManipulation.cs" /> 220 226 <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeManipulator.cs" /> … … 240 246 <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeOperator.cs" /> 241 247 <Compile Include="SymbolicExpressionTree.cs" /> 242 <Compile Include="Properties\AssemblyInfo.cs" />243 248 <Compile Include="SymbolicExpressionTreeNode.cs" /> 244 249 <Compile Include="Symbols\Argument.cs" /> … … 258 263 <None Include="Plugin.cs.frame" /> 259 264 <None Include="Properties\AssemblyInfo.cs.frame" /> 265 <Compile Include="Properties\AssemblyInfo.cs" /> 260 266 </ItemGroup> 261 267 <ItemGroup> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
r9835 r9963 111 111 if (layers[i].Rank.IsAlmost(rank)) { 112 112 var visualTextNode = new VisualGenealogyGraphTextLabel(Chart, x, y + 2, x + Diameter, y + Diameter) { 113 Brush = new SolidBrush(Color.Black),113 FontBrush = new SolidBrush(Color.Black), 114 114 Font = new Font("Arial", Diameter - 4, FontStyle.Regular, GraphicsUnit.Pixel), 115 115 Text = String.Format("{0:0}", rank) … … 154 154 } 155 155 // add arcs separately (to avoid some ordering problems) 156 foreach (SymbolicExpression GenealogyGraphNode node in Graph.Nodes) {156 foreach (SymbolicExpressionTreeGenealogyGraphNode node in Graph.Nodes) { 157 157 VisualGenealogyGraphNode visualNode = GetVisualGenealogyGraphNode(node); 158 158 if (node.InEdges == null) continue; … … 171 171 172 172 // var brush = new SolidBrush(Color.BlueViolet); 173 // visualGraphNode. Brush = brush;173 // visualGraphNode.FontBrush = brush; 174 174 // } 175 175 … … 267 267 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 268 268 arc.Pen.Color = Color.Transparent; 269 // arc.Pen. Brush = new SolidBrush(Color.DarkGray);269 // arc.Pen.FontBrush = new SolidBrush(Color.DarkGray); 270 270 DrawLineage(nodeSelector(arc), arcSelector, nodeSelector); 271 271 } … … 300 300 } 301 301 302 public void HighlightNodes(IEnumerable<SymbolicExpression GenealogyGraphNode> nodes) {302 public void HighlightNodes(IEnumerable<SymbolicExpressionTreeGenealogyGraphNode> nodes) { 303 303 Chart.UpdateEnabled = false; 304 304 ClearAllNodes(); … … 333 333 } 334 334 335 public void HighlightNode(SymbolicExpression GenealogyGraphNode graphNode, Color color) {335 public void HighlightNode(SymbolicExpressionTreeGenealogyGraphNode graphNode, Color color) { 336 336 GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(color); 337 337 } … … 388 388 389 389 internal static class Util { 390 public static Color GetColor(this SymbolicExpression GenealogyGraphNode node) {390 public static Color GetColor(this SymbolicExpressionTreeGenealogyGraphNode node) { 391 391 var colorIndex = (int)(node.Quality * ColorGradient.Colors.Count); 392 392 if (colorIndex >= ColorGradient.Colors.Count) --colorIndex; -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
r9835 r9963 231 231 232 232 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 => (SymbolicExpression GenealogyGraphNode)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(); 234 234 genealogyGraphChart.HighlightNodes(nodes); 235 235 } 236 236 237 237 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 => (SymbolicExpression GenealogyGraphNode)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(); 239 239 genealogyGraphChart.HighlightNodes(nodes); 240 240 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj
r9835 r9963 109 109 </ItemGroup> 110 110 <ItemGroup> 111 <Compile Include="AncestryLayoutAdapter.cs" /> 112 <Compile Include="ExtendedSymbolicExpressionTreeCanvas.cs"> 113 <SubType>UserControl</SubType> 114 </Compile> 111 115 <Compile Include="FrequentFragmentsDialog.cs"> 112 116 <SubType>Form</SubType> … … 133 137 <DependentUpon>GenealogyGraphView.cs</DependentUpon> 134 138 </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>141 139 <Compile Include="LineageExplorerView.cs"> 142 140 <SubType>UserControl</SubType> … … 146 144 </Compile> 147 145 <Compile Include="Plugin.cs" /> 146 <Compile Include="Primitives\LabeledEllipse.cs" /> 147 <Compile Include="Primitives\LabeledRectangle.cs" /> 148 <Compile Include="Primitives\PrimitiveGroup.cs" /> 148 149 <Compile Include="Properties\AssemblyInfo.cs" /> 149 150 <Compile Include="Properties\Resources.Designer.cs"> … … 182 183 </ItemGroup> 183 184 <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>196 185 <EmbeddedResource Include="Properties\Resources.resx"> 197 186 <Generator>ResXFileCodeGenerator</Generator> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.Designer.cs
r9835 r9963 44 44 this.consideredTrees = new System.Windows.Forms.Label(); 45 45 this.tabPage3 = new System.Windows.Forms.TabPage(); 46 this.karyograph1 = new HeuristicLab.EvolutionaryTracking.Views.Karyogram();47 46 this.karyographTab.SuspendLayout(); 48 47 this.tabPage1.SuspendLayout(); … … 91 90 // qualityImprovementTreeView 92 91 // 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) 94 93 | System.Windows.Forms.AnchorStyles.Right))); 95 94 this.qualityImprovementTreeView.HideSelection = false; … … 102 101 // symbolicExpressionTreeChart 103 102 // 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) 106 105 | System.Windows.Forms.AnchorStyles.Right))); 107 106 this.symbolicExpressionTreeChart.BackgroundColor = System.Drawing.Color.White; … … 250 249 // tabPage3 251 250 // 252 this.tabPage3.Controls.Add(this.karyograph1);253 251 this.tabPage3.Location = new System.Drawing.Point(4, 22); 254 252 this.tabPage3.Name = "tabPage3"; … … 258 256 this.tabPage3.Text = "Karyograph"; 259 257 this.tabPage3.UseVisualStyleBackColor = true; 260 //261 // karyograph1262 //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;271 258 // 272 259 // LineageExplorerView … … 311 298 private System.Windows.Forms.Panel panel4; 312 299 private System.Windows.Forms.TabPage tabPage3; 313 private Karyogram karyograph1;314 315 316 317 318 319 320 321 300 } 322 301 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.cs
r9835 r9963 16 16 public sealed partial class LineageExplorerView : ItemView { 17 17 private Dictionary<TreeNode, ISymbolicExpressionTree> treeMap; 18 private List<SymbolicExpression GenealogyGraphNode> lineage;18 private List<SymbolicExpressionTreeGenealogyGraphNode> lineage; 19 19 20 20 private Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>> fragmentFrequencies; … … 59 59 } 60 60 } 61 62 karyograph1.Trees = Content.Trees.OrderByDescending(x => x.Item2).Select(x => x.Item1).ToList();63 61 } 64 62 … … 94 92 95 93 var graphNode = Content.GenealogyGraph.GetGraphNodes(symbExprTree).Last(); 96 lineage = lineage ?? new List<SymbolicExpression GenealogyGraphNode>();94 lineage = lineage ?? new List<SymbolicExpressionTreeGenealogyGraphNode>(); 97 95 lineage.Clear(); 98 96 lineage.Add(graphNode); … … 100 98 var gn = graphNode; 101 99 while (gn.InEdges != null && gn.InEdges.Count != 0) { 102 gn = (SymbolicExpression GenealogyGraphNode)gn.InEdges[0].Source;100 gn = (SymbolicExpressionTreeGenealogyGraphNode)gn.InEdges[0].Source; 103 101 lineage.Add(gn); 104 102 } … … 127 125 symbolicExpressionTreeChart.Tree = symbExprTree; 128 126 var matchingNodes = Content.GenealogyGraph.GetGraphNodes(symbExprTree); 129 SymbolicExpression GenealogyGraphNode graphNode = matchingNodes.First();127 SymbolicExpressionTreeGenealogyGraphNode graphNode = matchingNodes.First(); 130 128 if (graphNode.InEdges == null) { 131 129 symbolicExpressionTreeChart.SuspendRepaint = false; -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs
r9420 r9963 27 27 namespace HeuristicLab.EvolutionaryTracking.Views { 28 28 public class VisualGenealogyGraphNode : Ellipse { 29 public SymbolicExpression GenealogyGraphNode Data { get; internal set; }29 public SymbolicExpressionTreeGenealogyGraphNode Data { get; internal set; } 30 30 private List<VisualGenealogyGraphArc> incomingArcs = new List<VisualGenealogyGraphArc>(); 31 31 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; 1 using System.Drawing; 3 2 using HeuristicLab.Visualization; 4 3 using Rectangle = HeuristicLab.Visualization.Rectangle; … … 12 11 public Font Font { get { return font; } set { font = value; } } 13 12 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; } } 16 15 17 16 public VisualGenealogyGraphTextLabel(IChart chart, PointD lowerLeft, PointD upperRight) … … 34 33 float fontSize = s.Height; 35 34 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); 37 36 } 38 37 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(); 43 41 } 44 base.OnUpdate();45 42 } 46 43 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Analyzers/SymbolicExpressionTreeEvolvabilityAnalyzer.cs
r9835 r9963 159 159 where graphNode.InEdges.Count == 1 160 160 // mutation 161 let source = (SymbolicExpression GenealogyGraphNode)graphNode.InEdges[0].Source161 let source = (SymbolicExpressionTreeGenealogyGraphNode)graphNode.InEdges[0].Source 162 162 where graphNode.SymbolicExpressionTree != source.SymbolicExpressionTree // skip elites 163 163 select source).ToList(); … … 177 177 switch (graphNode.InEdges.Count) { 178 178 case 2: { 179 parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpression GenealogyGraphNode)e.Source).Quality);179 parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpressionTreeGenealogyGraphNode)e.Source).Quality); 180 180 crossoverImprovements.Add(quality - parentQuality); 181 181 break; 182 182 } 183 183 case 1: { 184 parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpression GenealogyGraphNode)e.Source).Quality);184 parentQuality = graphNode.InEdges.Max(e => ((SymbolicExpressionTreeGenealogyGraphNode)e.Source).Quality); 185 185 if (ConstantOptimizationIntermediateParents.Value && ConstantOptimizationEvaluator != null) { 186 186 187 187 //Get the optimized fitness of the intermediate parent (without actually updating the constants in the tree) 188 var intermediateParent = ((SymbolicExpression GenealogyGraphNode)graphNode.InEdges[0].Source).SymbolicExpressionTree;188 var intermediateParent = ((SymbolicExpressionTreeGenealogyGraphNode)graphNode.InEdges[0].Source).SymbolicExpressionTree; 189 189 parentQuality = Evaluate(intermediateParent, ConstantOptimizationEvaluator); 190 190 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/HeuristicLab.EvolutionaryTracking-3.4.csproj
r9835 r9963 131 131 </ItemGroup> 132 132 <ItemGroup> 133 <Compile Include="Analyzers\BuildingBlocks\BuildingBlockHistoryAnalyzer.cs" />134 133 <Compile Include="Analyzers\BuildingBlocks\RelevantBuildingBlocksAnalyzer.cs" /> 135 134 <Compile Include="Analyzers\BuildingBlocks\Poly10BuildingBlocksAnalyzer.cs" /> 136 <Compile Include="Analyzers\LineageRetrofittingAnalyzer.cs" />137 135 <Compile Include="Analyzers\SymbolicExpressionTreePruningAnalyzer.cs" /> 138 136 <Compile Include="Analyzers\SymbolicExpressionTreeShapeAnalyzer.cs" /> … … 162 160 <Compile Include="Properties\AssemblyInfo.cs" /> 163 161 <Compile Include="SymbolGraph.cs" /> 164 <Compile Include="SymbolicExpressionTreeGenealogyGraph.cs" /> 162 <Compile Include="SymbolicExpressionTreeGenealogyGraph\SymbolicExpressionTreeGenealogyGraph.cs" /> 163 <Compile Include="SymbolicExpressionTreeGenealogyGraph\SymbolicExpressionTreeGenealogyGraphNode.cs" /> 165 164 </ItemGroup> 166 165 <ItemGroup /> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Interfaces/ISymbolicExpressionTreeGenealogyGraph.cs
r9419 r9963 24 24 25 25 namespace HeuristicLab.EvolutionaryTracking { 26 public interface ISymbolicExpressionTreeGenealogyGraph : IGenericGraph<SymbolicExpression GenealogyGraphNode> {27 List<SymbolicExpression GenealogyGraphNode> GetGraphNodes(ISymbolicExpressionTree tree);26 public interface ISymbolicExpressionTreeGenealogyGraph : IGenericGraph<SymbolicExpressionTreeGenealogyGraphNode> { 27 List<SymbolicExpressionTreeGenealogyGraphNode> GetGraphNodes(ISymbolicExpressionTree tree); 28 28 } 29 29 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/Operators/SymbolicExpressionTreeGenealogyGraphBuilder.cs
r9835 r9963 214 214 var tree = pair.Tree; 215 215 var quality = pair.Quality; 216 graph.AddNode(new SymbolicExpression GenealogyGraphNode {216 graph.AddNode(new SymbolicExpressionTreeGenealogyGraphNode { 217 217 SymbolicExpressionTree = tree, 218 218 Quality = quality, … … 226 226 let tree = pairs[i].Tree 227 227 let quality = pairs[i].Quality 228 select new SymbolicExpression GenealogyGraphNode {228 select new SymbolicExpressionTreeGenealogyGraphNode { 229 229 SymbolicExpressionTree = tree, 230 230 Quality = quality, … … 240 240 // 1 parent means mutation 241 241 let p = (ISymbolicExpressionTree)parents[0] 242 select new SymbolicExpression GenealogyGraphNode {242 select new SymbolicExpressionTreeGenealogyGraphNode { 243 243 SymbolicExpressionTree = p, 244 244 Quality = Evaluate(p), -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Optimization.Views/3.3/HeuristicLab.Optimization.Views-3.3.csproj
r9835 r9963 390 390 </BootstrapperPackage> 391 391 </ItemGroup> 392 <ItemGroup>393 <EmbeddedResource Include="RunCollectionViews\RunCollectionDataTableView.resx">394 <DependentUpon>RunCollectionDataTableView.cs</DependentUpon>395 </EmbeddedResource>396 </ItemGroup>397 392 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 398 393 <!-- 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 240 240 <Compile Include="SymbolicDataAnalysisProblem.cs" /> 241 241 <Compile Include="SymbolicDataAnalysisSolutionImpactValuesCalculator.cs" /> 242 <Compile Include="SymbolicDataAnalysisSolutionPruningOptimizer.cs" /> 242 243 <Compile Include="SymbolicDataAnalysisSolutionTextRenderer.cs" /> 243 244 <Compile Include="Symbols\Addition.cs" /> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SlidingWindow/SlidingWindowData.cs
r9162 r9963 61 61 : base(original, cloner) { 62 62 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); 64 67 } 65 68 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.