Changeset 11262
- Timestamp:
- 08/04/14 14:50:52 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphChart.cs
r10903 r11262 117 117 ToolTipText = "Rank: " + node.Rank + nl + 118 118 "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl + 119 "IsElite: " + node.IsElite 119 "IsElite: " + node.IsElite + nl + 120 "In/Out Degree: " + node.InDegree + " " + node.OutDegree 120 121 }; 121 122 Chart.Group.Add(visualNode); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/HeuristicLab.EvolutionTracking.Views-3.4.csproj
r11253 r11262 97 97 <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon> 98 98 </Compile> 99 <Compile Include="GenealogyGraphChart.cs" /> 99 <Compile Include="GenealogyGraphChart.cs"> 100 <SubType>UserControl</SubType> 101 </Compile> 100 102 <Compile Include="GenealogyGraphChart.Designer.cs"> 101 103 <DependentUpon>GenealogyGraphChart.cs</DependentUpon> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
r11257 r11262 272 272 var prevVertex = (IGenealogyGraphNode<T>)GenealogyGraph.GetByContent(elite); 273 273 prevVertex.IsElite = true; // mark elites in the graph retroactively 274 var w = new GenealogyGraphNode<T>(prevVertex); //shallow copy, arcs are not copied274 var w = (IGenealogyGraphNode<T>)prevVertex.Clone(); 275 275 var v = new GenealogyGraphNode<T>(prevVertex.Data) { 276 276 Rank = generation, … … 321 321 int generation = GenerationsParameter.ActualValue.Value; 322 322 var population = PopulationParameter.ActualValue; 323 var discardedOffspring = GenealogyGraph.Ranks[generation].Select(x => (T)x.Data).Except(population) ;323 var discardedOffspring = GenealogyGraph.Ranks[generation].Select(x => (T)x.Data).Except(population).ToList(); 324 324 foreach (var vertex in discardedOffspring.Select(individual => GenealogyGraph.GetByContent(individual))) { 325 325 if (vertex.InDegree == 1) { 326 326 var p = vertex.Parents.First(); 327 if ( p.Rank.Equals(generation - 1))327 if (!p.Rank.Equals(generation - 0.5)) 328 328 throw new InvalidOperationException("Parent must be an intermediate vertex"); 329 329 GenealogyGraph.RemoveVertex(p); -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs
r11253 r11262 36 36 public override IDeepCloneable Clone(Cloner cloner) { 37 37 return new GenealogyGraphNode(this, cloner); 38 }39 40 // this constructor emulates the behavior of a copy constructor41 // it returns a shallow copy in which the arcs are not cloned42 protected GenealogyGraphNode(IGenealogyGraphNode original)43 : base((IDeepCloneable)original.Data.Clone()) {44 Quality = original.Quality;45 Rank = original.Rank;46 IsElite = original.IsElite;47 Id = Guid.NewGuid().ToString();48 38 } 49 39 … … 146 136 } 147 137 148 public GenealogyGraphNode(IGenealogyGraphNode<T> original) : base(original) { } 138 [StorableConstructor] 139 protected GenealogyGraphNode(bool deserializing) : base(deserializing) { } 149 140 150 141 public GenealogyGraphNode(IDeepCloneable content) : base(content) { }
Note: See TracChangeset
for help on using the changeset viewer.