Changeset 10884
- Timestamp:
- 05/21/14 23:39:19 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs
r10839 r10884 28 28 using HeuristicLab.Common; 29 29 using HeuristicLab.Visualization; 30 31 30 using Rectangle = HeuristicLab.Visualization.Rectangle; 32 31 … … 143 142 Clear(); 144 143 var actualRoot = Root; 145 if (Root.Symbol is ProgramRootSymbol && Root.SubtreeCount == 1) { actualRoot = Root.GetSubtree(0).GetSubtree(0); }144 // if (Root.Symbol is ProgramRootSymbol && Root.SubtreeCount == 1) { actualRoot = Root.GetSubtree(0).GetSubtree(0); } 146 145 147 146 LayoutEngine.NodeWidth = PreferredNodeWidth; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj
r10514 r10884 97 97 <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon> 98 98 </Compile> 99 <Compile Include="GenealogyGraphChart.cs"> 100 <SubType>UserControl</SubType> 101 </Compile> 99 <Compile Include="GenealogyGraphChart.cs" /> 102 100 <Compile Include="GenealogyGraphChart.Designer.cs"> 103 101 <DependentUpon>GenealogyGraphChart.cs</DependentUpon> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
r10833 r10884 1 using System.Linq; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System.Linq; 2 23 using HeuristicLab.Common; 3 24 using HeuristicLab.Core; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/DirectedGraph.cs
r10833 r10884 33 33 public class DirectedGraph : Item, IDirectedGraph { 34 34 [Storable] 35 pr otectedreadonly List<IVertex> nodes; // for performance reasons, maybe this should be a linked list (fast remove)36 public List<IVertex> Nodes {35 private readonly List<IVertex> nodes; // for performance reasons, maybe this should be a linked list (fast remove) 36 public IEnumerable<IVertex> Nodes { 37 37 get { return nodes; } 38 38 } 39 40 [Storable] 41 private readonly Dictionary<string, IVertex> idMap; 42 39 43 [Storable] 40 44 private readonly Dictionary<object, IVertex> contentMap; … … 42 46 nodes = new List<IVertex>(); 43 47 contentMap = new Dictionary<object, IVertex>(); 48 idMap = new Dictionary<string, IVertex>(); 44 49 } 45 50 [StorableConstructor] … … 51 56 nodes = new List<IVertex>(original.Nodes); 52 57 contentMap = new Dictionary<object, IVertex>(original.contentMap); 58 idMap = new Dictionary<string, IVertex>(original.idMap); 53 59 } 54 60 public override IDeepCloneable Clone(Cloner cloner) { … … 62 68 return contentMap.ContainsKey(content); 63 69 } 70 71 public IVertex GetVertex(string id) { 72 IVertex result; 73 idMap.TryGetValue(id, out result); 74 return result; 75 } 76 64 77 public IVertex this[object key] { 65 78 get { … … 69 82 } 70 83 set { 84 if (contentMap.ContainsKey(key)) { 85 idMap.Remove(contentMap[key].Id); 86 } 71 87 contentMap[key] = value; 88 idMap[value.Id] = value; 72 89 } 73 90 } … … 81 98 nodes.Clear(); 82 99 contentMap.Clear(); 100 idMap.Clear(); 83 101 } 84 102 public virtual void AddVertex(IVertex vertex) { … … 87 105 } 88 106 contentMap[vertex.Content] = vertex; 89 Nodes.Add(vertex); 107 idMap[vertex.Id] = vertex; 108 nodes.Add(vertex); 90 109 } 91 110 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Interfaces/IDirectedGraph.cs
r10833 r10884 31 31 void AddVertex(IVertex vertex); 32 32 void RemoveVertex(IVertex vertex); 33 List<IVertex> Nodes { get; }33 IEnumerable<IVertex> Nodes { get; } 34 34 IVertex this[object content] { get; set; } 35 35 bool Contains(object content); 36 IVertex GetVertex(string id); 36 37 } 37 38 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeCrossoverOperator.cs
r10830 r10884 63 63 } 64 64 65 private readonly Func<IScope, string> getScopeId = s => ((StringValue)s.Variables["Id"].Value).Value; 65 66 public override IOperation Apply() { 66 67 if (CurrentGeneration == null) throw new Exception(); 67 var parentVertices = (from s in ExecutionContext.Scope.SubScopes 68 let id = ((StringValue)s.Variables["Id"].Value).Value 69 select CurrentGeneration.First(x => x.Id == id)).ToList(); // the id is unique 68 var subScopes = ExecutionContext.Scope.SubScopes; 69 var parentVertices = subScopes.Select(x => (GenealogyGraphNode<T>)GenealogyGraph.GetVertex(getScopeId(x))).ToList(); 70 70 71 71 var parents = ParentsParameter.ActualValue.ToList(); 72 72 73 73 var childVertex = new GenealogyGraphNode<T> { 74 // the child parameter does not have a value yet (it will be assigned after crossover), but the first parent is actually the future child so we use this 74 // the child parameter does not have a value yet (it will be assigned after crossover), 75 // but the first parent is actually the future child so we use this 75 76 Content = parents[0], 76 77 Rank = parentVertices[0].Rank + 1 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r10827 r10884 279 279 <DependentUpon>SymboldDataAnalysisGenealogyView.cs</DependentUpon> 280 280 </Compile> 281 <Compile Include="Tracking\SymbolicDataAnalysisExpressionGenealogyGraphChart.cs"> 282 <SubType>UserControl</SubType> 283 </Compile> 281 <Compile Include="Tracking\SymbolicDataAnalysisExpressionGenealogyGraphChart.cs" /> 284 282 <Compile Include="Tracking\SymbolicDataAnalysisExpressionGenealogyGraphChart.Designer.cs"> 285 283 <DependentUpon>SymbolicDataAnalysisExpressionGenealogyGraphChart.cs</DependentUpon> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs
r10840 r10884 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Drawing; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Matching/SymbolicExpressionTreeNodeSimilarityComparer.cs
r10650 r10884 1 using HeuristicLab.Common; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Common; 2 23 using HeuristicLab.Core; 3 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SymbolicDataAnalysisExpressionTracing.cs
r10838 r10884 1 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 2 22 using System; 3 23 using System.Collections.Generic;
Note: See TracChangeset
for help on using the changeset viewer.