Changeset 8411 for branches/HeuristicLab.Analysis.AlgorithmBehavior
- Timestamp:
- 08/05/12 22:05:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
r8410 r8411 29 29 using HeuristicLab.Operators; 30 30 using HeuristicLab.Optimization; 31 using HeuristicLab.Optimization.Operators;32 31 using HeuristicLab.Parameters; 33 32 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 using HeuristicLab.Problems.TravelingSalesman; 34 34 35 35 namespace HeuristicLab.Analysis.AlgorithmBehavior.Analyzers { … … 66 66 get { return (ILookupParameter<Permutation>)Parameters["PermutationAfterMutation"]; } 67 67 } 68 public IValueParameter<SingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter {69 get { return (IValueParameter<SingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; }70 }71 68 #endregion 72 69 … … 78 75 79 76 ScatterPlot plot, diversityPlot; 80 DataRow dtRow , dtDivRow;77 DataRow dtRow; 81 78 int cnt = 0; 82 79 … … 96 93 97 94 Parameters.Add(new LookupParameter<Permutation>("PermutationBeforeMutation")); 98 QualityAfterMutationParameter.ActualName = "TSPTourClone";95 PermutationBeforeMutationParameter.ActualName = "TSPTourClone"; 99 96 100 97 Parameters.Add(new LookupParameter<Permutation>("PermutationAfterMutation")); 101 QualityAfterMutationParameter.ActualName = "TSPTour"; 102 103 Parameters.Add(new ValueParameter<SingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator")); 98 PermutationAfterMutationParameter.ActualName = "TSPTour"; 104 99 } 105 100 … … 109 104 110 105 public override IOperation Apply() { 111 Point2D<double> curPoint ;106 Point2D<double> curPoint, divPoint; 112 107 var qualityCX = QualityAfterCrossoverParameter.ActualValue.Value; 113 108 var qualityM = QualityAfterMutationParameter.ActualValue.Value; 109 var permutationBefore = PermutationBeforeMutationParameter.ActualValue; 110 var permutationAfter = PermutationAfterMutationParameter.ActualValue; 114 111 112 divPoint = new Point2D<double>(cnt, TSPSimilarityCalculator.CalculateSimilarity(permutationBefore, permutationAfter)); 115 113 curPoint = new Point2D<double>(cnt++, qualityCX - qualityM); 116 114 117 115 string curGenStr = GenerationsParameter.ActualValue.Value.ToString(); 118 ScatterPlotDataRow row ;116 ScatterPlotDataRow row, divRow; 119 117 120 118 if (!Results.ContainsKey("Mutation Scatter Plot")) { 121 119 InitializePlot(); 120 InitializeDiversityPlot(); 122 121 Results.Add(new Result("Mutation Scatter Plot", plot)); 123 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())); 124 125 cnt = 0; 125 126 … … 136 137 dtRow.Values.Add(avg); 137 138 ((ScatterPlotHistory)Results["Mutation Scatter Plot History"].Value).Add(plot); 139 ((ScatterPlotHistory)Results["Mutation Diversity Plot History"].Value).Add(diversityPlot); 138 140 } 139 141 InitializePlot(); 142 InitializeDiversityPlot(); 140 143 Results["Mutation Scatter Plot"].Value = plot; 144 Results["Mutation Diversity Plot"].Value = diversityPlot; 141 145 cnt = 0; 142 146 } … … 148 152 row.VisualProperties.PointSize = 5; 149 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); 150 161 } else { 151 162 plot.Rows[curGenStr].Points.Add(curPoint); 163 diversityPlot.Rows[curGenStr].Points.Add(divPoint); 152 164 } 153 165
Note: See TracChangeset
for help on using the changeset viewer.