Changeset 8498
- Timestamp:
- 08/18/12 00:15:40 (12 years ago)
- Location:
- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DuplicateSolutionsAnalyzer.cs
r8415 r8498 56 56 } 57 57 58 private Data Row dtRow;58 private DataTableHelper chartingHelper; 59 59 #endregion 60 60 … … 68 68 SimilarityCalculatorParameter.Value.SolutionVariableName = "TSPTour"; 69 69 SimilarityCalculatorParameter.Value.QualityVariableName = "TSPTourLength"; 70 71 chartingHelper = new DataTableHelper(); 70 72 } 71 73 … … 75 77 76 78 public override IOperation Apply() { 77 if (!Results.ContainsKey("Duplicate Solutions")) { 78 DataTable dt = new DataTable("Duplicate Solutions"); 79 dtRow = new DataRow("Duplicate Solutions per Generation"); 80 dt.Rows.Add(dtRow); 81 Results.Add(new Result("Duplicate Solutions", dt)); 82 } 79 chartingHelper.InitializeChart(Results, "Duplicate Solutions", "Duplicate Solutions per Generation"); 83 80 84 81 var similarities = SimilarityCalculatorParameter.Value.CalculateSolutionCrowdSimilarity(ExecutionContext.Scope); … … 92 89 } 93 90 } 94 dtRow.Values.Add(counter);95 91 92 chartingHelper.AddPoint(counter); 96 93 return base.Apply(); 97 94 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers-3.3.csproj
r8496 r8498 96 96 <ItemGroup> 97 97 <Compile Include="AlgorithmBehaviorHelpers.cs" /> 98 <Compile Include="ScatterPlotHelper.cs" /> 99 <Compile Include="DataTableHelper.cs" /> 98 100 <Compile Include="DuplicateSolutionsAnalyzer.cs" /> 99 101 <Compile Include="MutationPerformanceAnalyzer.cs" /> … … 106 108 <None Include="HeuristicLab.snk" /> 107 109 <None Include="Plugin.cs.frame" /> 110 <None Include="Properties\AssemblyInfo.cs.frame" /> 108 111 </ItemGroup> 109 112 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
r8415 r8498 74 74 #endregion 75 75 76 ScatterPlot plot, diversityPlot; 77 DataRow dtRow; 78 int cnt = 0; 76 77 ScatterPlotHelper diversityPlotHelper, qualityPlotHelper; 78 DataTableHelper avgDataTableHelper; 79 int cnt = 0, lastGeneration = 0; 80 List<double> qualityPoints = new List<double>(); 79 81 80 82 [StorableConstructor] … … 97 99 Parameters.Add(new LookupParameter<Permutation>("PermutationAfterMutation")); 98 100 PermutationAfterMutationParameter.ActualName = "TSPTour"; 101 102 diversityPlotHelper = new ScatterPlotHelper(); 103 qualityPlotHelper = new ScatterPlotHelper(); 104 avgDataTableHelper = new DataTableHelper(); 99 105 } 100 106 … … 105 111 public override IOperation Apply() { 106 112 Point2D<double> curPoint, divPoint; 113 107 114 var qualityCX = QualityAfterCrossoverParameter.ActualValue.Value; 108 115 var qualityM = QualityAfterMutationParameter.ActualValue.Value; … … 110 117 var permutationAfter = PermutationAfterMutationParameter.ActualValue; 111 118 119 qualityPlotHelper.InitializePlot(Results, "Mutation Quality", "Solution Index", "Absolut Quality Difference"); 120 diversityPlotHelper.InitializePlot(Results, "Mutation Diversity", "Solution Index", "Diversity"); 121 avgDataTableHelper.InitializeChart(Results, "Average Mutation Performance", "Average Mutation Performance per Generation"); 122 112 123 divPoint = new Point2D<double>(cnt, TSPSimilarityCalculator.CalculateSimilarity(permutationBefore, permutationAfter)); 113 124 curPoint = new Point2D<double>(cnt++, qualityCX - qualityM); 125 qualityPoints.Add(curPoint.Y); 114 126 115 127 string curGenStr = GenerationsParameter.ActualValue.Value.ToString(); 116 ScatterPlotDataRow row, divRow;117 128 118 if (!Results.ContainsKey("Mutation Scatter Plot")) { 119 InitializePlot(); 120 InitializeDiversityPlot(); 121 Results.Add(new Result("Mutation Scatter Plot", plot)); 122 Results.Add(new Result("Mutation Scatter Plot History", new ScatterPlotHistory())); 123 Results.Add(new Result("Mutation Diversity Plot", diversityPlot)); 124 Results.Add(new Result("Mutation Diversity Plot History", new ScatterPlotHistory())); 125 cnt = 0; 129 qualityPlotHelper.AddPoint(curGenStr, curPoint); 130 diversityPlotHelper.AddPoint(curGenStr, divPoint); 126 131 127 DataTable dt = new DataTable("Average Mutation Performance"); 128 dtRow = new DataRow("Average Mutation Performance per Generation"); 129 dt.Rows.Add(dtRow); 130 Results.Add(new Result("Average Mutation Performance", dt)); 131 } 132 133 if (!plot.Rows.ContainsKey(curGenStr)) { 134 if (GenerationsParameter.ActualValue.Value != 0) { 135 if (plot.Rows.ContainsKey((GenerationsParameter.ActualValue.Value - 1).ToString())) { 136 double avg = plot.Rows[(GenerationsParameter.ActualValue.Value - 1).ToString()].Points.Average(x => x.Y); 137 dtRow.Values.Add(avg); 138 ((ScatterPlotHistory)Results["Mutation Scatter Plot History"].Value).Add(plot); 139 ((ScatterPlotHistory)Results["Mutation Diversity Plot History"].Value).Add(diversityPlot); 140 } 141 InitializePlot(); 142 InitializeDiversityPlot(); 143 Results["Mutation Scatter Plot"].Value = plot; 144 Results["Mutation Diversity Plot"].Value = diversityPlot; 132 if (GenerationsParameter.ActualValue.Value != 0) { 133 if (GenerationsParameter.ActualValue.Value > lastGeneration) { 134 double avg = qualityPoints.Average(); 135 avgDataTableHelper.AddPoint(avg); 145 136 cnt = 0; 137 lastGeneration = GenerationsParameter.ActualValue.Value; 138 qualityPoints.Clear(); 146 139 } 147 148 var points = new List<Point2D<double>>();149 points.Add(curPoint);150 row = new ScatterPlotDataRow(curGenStr, null, points);151 row.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;152 row.VisualProperties.PointSize = 5;153 plot.Rows.Add(row);154 155 points = new List<Point2D<double>>();156 points.Add(divPoint);157 divRow = new ScatterPlotDataRow(curGenStr, null, points);158 divRow.VisualProperties.PointStyle = ScatterPlotDataRowVisualProperties.ScatterPlotDataRowPointStyle.Circle;159 divRow.VisualProperties.PointSize = 5;160 diversityPlot.Rows.Add(divRow);161 } else {162 plot.Rows[curGenStr].Points.Add(curPoint);163 diversityPlot.Rows[curGenStr].Points.Add(divPoint);164 140 } 165 141 166 142 return base.Apply(); 167 143 } 168 169 private void InitializePlot() {170 plot = new ScatterPlot("Mutation Performance", null);171 plot.VisualProperties.XAxisTitle = "Solution Index";172 plot.VisualProperties.YAxisTitle = "Absolut Quality Difference";173 }174 175 private void InitializeDiversityPlot() {176 diversityPlot = new ScatterPlot("Mutation Diversity", null);177 diversityPlot.VisualProperties.XAxisTitle = "Solution Index";178 diversityPlot.VisualProperties.YAxisTitle = "Diversity";179 }180 144 } 181 145 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/Properties/AssemblyInfo.cs.frame
r8336 r8498 27 27 // set of attributes. Change these attribute values to modify the information 28 28 // associated with an assembly. 29 [assembly: AssemblyTitle("HeuristicLab.Analysis.AlgorithmBehavior ")]30 [assembly: AssemblyDescription("Provides operators and related classes for tracking the evolution within a GA.")]29 [assembly: AssemblyTitle("HeuristicLab.Analysis.AlgorithmBehavior.Analyzers")] 30 [assembly: AssemblyDescription("Provides analyzers for tracking the behavior of GAs.")] 31 31 [assembly: AssemblyConfiguration("")] 32 32 [assembly: AssemblyCompany("")] … … 54 54 // by using the '*' as shown below: 55 55 [assembly: AssemblyVersion("3.3.0.0")] 56 [assembly: AssemblyFileVersion("3.3. 6.$WCREV$")]56 [assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.