Changeset 11288
- Timestamp:
- 08/19/14 16:05:16 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Analyzers/GenealogyAnalyzer.cs
r11278 r11288 346 346 foreach (var ind in population) { 347 347 var v = GenealogyGraph.GetByContent(ind); 348 foreach (var p in v.Parents) 349 p.Weight++; 348 if (v.Parents.Count() == 1) { 349 var p = v.Parents.First(); 350 foreach (var pp in p.Parents) 351 pp.Weight++; 352 } else { 353 foreach (var p in v.Parents) { 354 p.Weight++; 355 } 356 } 350 357 } 351 358 … … 364 371 } 365 372 var successfulOffspringRatioTable = new DataTable(); 366 var successfulOffspringRatioRow = new DataRow("Successful Offspring Ratio") { VisualProperties = { ChartType = DataRowVisualProperties.DataRowChartType.Columns, StartIndexZero = true } }; 373 var successfulOffspringRatioRow = new DataRow("Successful Offspring Ratio") { 374 VisualProperties = { ChartType = DataRowVisualProperties.DataRowChartType.Columns, StartIndexZero = true } 375 }; 367 376 successfulOffspringRatioRow.Values.Replace(GenealogyGraph.Ranks[generation - 1].OrderByDescending(x => x.Quality).Select(x => x.OutDegree > 0 ? x.Weight / x.OutDegree : 0)); 368 377 successfulOffspringRatioTable.Rows.Add(successfulOffspringRatioRow); … … 385 394 386 395 var successfulOffspringValuesTable = new DataTable(); 387 var successfulOffspringValuesRow = new DataRow("Successful Offspring Ratio") {396 var successfulOffspringValuesRow = new DataRow("Successful Offspring Values") { 388 397 VisualProperties = { ChartType = DataRowVisualProperties.DataRowChartType.Columns, StartIndexZero = true } 389 398 }; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
r11257 r11288 54 54 // since mutation always takes place after crossover, the vertex for the current child is already in the tree 55 55 var v = (IGenealogyGraphNode<T>)GenealogyGraph.GetByContent(ChildParameter.ActualValue); 56 var c lone = (T)ChildParameter.ActualValue.Clone();57 var c = new GenealogyGraphNode<T>(clone) { Rank = v.Rank - 0.5 };56 var c = (IGenealogyGraphNode<T>)v.Clone(); 57 c.Rank = v.Rank - 0.5; 58 58 GenealogyGraph.AddVertex(c); 59 59
Note: See TracChangeset
for help on using the changeset viewer.