Changeset 9418 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers
- Timestamp:
- 05/02/13 13:15:07 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DuplicateSolutionsAnalyzer.cs
r8797 r9418 21 21 22 22 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Common; … … 59 60 60 61 [Storable] 61 private DataTableHelper chartingHelper ;62 private DataTableHelper chartingHelper, similarityChartHelper; 62 63 #endregion 63 64 … … 68 69 : base(original, cloner) { 69 70 chartingHelper = (DataTableHelper)original.chartingHelper.Clone(cloner); 71 similarityChartHelper = (DataTableHelper)original.similarityChartHelper.Clone(cloner); 70 72 } 71 73 … … 77 79 78 80 chartingHelper = new DataTableHelper(); 81 similarityChartHelper = new DataTableHelper(); 79 82 } 80 83 … … 88 91 } 89 92 chartingHelper.InitializeChart(Results, "Duplicate Solutions", new string[] { "Duplicate Solutions per Generation" }); 93 similarityChartHelper.InitializeChart(Results, "Average Similarity", new string[] { "Avg. Similarity per Generation" }); 90 94 91 95 var similarities = SimilarityCalculatorParameter.Value.CalculateSolutionCrowdSimilarity(ExecutionContext.Scope); 96 List<double> similaritiesArr = new List<double>(); 92 97 int counter = 0; 93 98 for (int i = 0; i < similarities.Length; i++) { … … 98 103 } 99 104 } 105 for (int j = 0; j < similarities[i].Length; j++) { 106 if (i != j) { 107 similaritiesArr.Add(similarities[i][j]); 108 } 109 } 100 110 } 101 111 112 similarityChartHelper.AddPoint(similaritiesArr.Average()); 102 113 chartingHelper.AddPoint(counter / (double)similarities.Length); 103 114 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.