Changeset 8739 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
- Timestamp:
- 10/04/12 16:19:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
r8661 r8739 66 66 get { return (ILookupParameter<Permutation>)Parameters["PermutationAfterMutation"]; } 67 67 } 68 public ILookupParameter<ItemCollection<IItem>> OperatorsParameter { 69 get { return (ILookupParameter<ItemCollection<IItem>>)Parameters["Operators"]; } 70 } 71 public IValueParameter<ISingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter { 72 get { return (IValueParameter<ISingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; } 73 } 68 74 #endregion 69 75 … … 112 118 PermutationAfterMutationParameter.ActualName = "TSPTour"; 113 119 120 Parameters.Add(new ValueParameter<ISingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator")); 121 Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.")); 122 114 123 diversityPlotHelper = new ScatterPlotHelper(false, true); 115 124 qualityPlotHelper = new ScatterPlotHelper(false, true); … … 124 133 Point2D<double> curPoint, divPoint; 125 134 135 if (SimilarityCalculatorParameter.Value == null) { 136 SimilarityCalculatorParameter.Value = OperatorsParameter.ActualValue.OfType<ISingleObjectiveSolutionSimilarityCalculator>().FirstOrDefault(); 137 } 138 126 139 var qualityCX = QualityAfterCrossoverParameter.ActualValue.Value; 127 140 var qualityM = QualityAfterMutationParameter.ActualValue.Value; … … 134 147 avgDataTableHelper.InitializeChart(Results, "Average Mutation Performance", "Average Mutation Performance per Generation"); 135 148 136 divPoint = new Point2D<double>(cnt, TSPSimilarityCalculator.CalculateSimilarity(permutationBefore, permutationAfter)); 149 Scope permutationBeforeScope = new Scope(); 150 Scope permutationAfterScope = new Scope(); 151 permutationBeforeScope.Variables.Add(new Variable(PermutationAfterMutationParameter.ActualName, permutationBefore)); 152 permutationAfterScope.Variables.Add(new Variable(PermutationAfterMutationParameter.ActualName, permutationAfter)); 153 154 divPoint = new Point2D<double>(cnt, SimilarityCalculatorParameter.Value.CalculateSolutionSimilarity(permutationBeforeScope, permutationAfterScope)); 137 155 curPoint = new Point2D<double>(cnt++, qualityCX - qualityM); 138 156 qualityPoints.Add(curPoint.Y);
Note: See TracChangeset
for help on using the changeset viewer.