Changeset 9150 for branches/HeuristicLab.Analysis.AlgorithmBehavior
- Timestamp:
- 01/13/13 01:08:08 (12 years ago)
- Location:
- branches/HeuristicLab.Analysis.AlgorithmBehavior
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.Views/3.3/SuccessorConfigurator.cs
r9095 r9150 33 33 34 34 public HeuristicOptimizationEngineAlgorithm Content { get; set; } 35 private CombinedOperator currentSuccessor = null;35 private HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.CombinedOperator currentSuccessor = null; 36 36 private Type operatorType = null; 37 37 … … 44 44 dialog.Caption = "Select Successor"; 45 45 dialog.TypeSelector.Caption = "Available Successor Operators"; 46 dialog.TypeSelector.Configure(typeof( CombinedOperator), false, true);46 dialog.TypeSelector.Configure(typeof(HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.CombinedOperator), false, true); 47 47 48 48 if (dialog.ShowDialog() == DialogResult.OK) { 49 currentSuccessor = ( CombinedOperator)dialog.TypeSelector.CreateInstanceOfSelectedType();49 currentSuccessor = (HeuristicLab.Analysis.AlgorithmBehavior.Analyzers.CombinedOperator)dialog.TypeSelector.CreateInstanceOfSelectedType(); 50 50 successorTextBox.Text = currentSuccessor.ToString(); 51 51 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs
r9054 r9150 126 126 127 127 128 worseParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true );129 betterParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true );128 worseParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true, true); 129 betterParentCrossoverPerformancePlot = new ScatterPlotHelper(false, true, true); 130 130 childDiversityToWorseParentHelper = new ScatterPlotHelper(false, true); 131 131 childDiversityToBetterParentHelper = new ScatterPlotHelper(false, true); 132 132 unwantedMutationsHelper = new ScatterPlotHelper(false, true); 133 133 parentDiversityHelper = new ScatterPlotHelper(false, true); 134 parentQualityHelper = new ScatterPlotHelper(false, true );134 parentQualityHelper = new ScatterPlotHelper(false, true, true); 135 135 successHelper = new DataTableHelper(); 136 136 equalParentsHelper = new DataTableHelper(); … … 239 239 240 240 for (int i = 0; i < ComparisonFactorParameter.Value.Count; i++) { 241 successHelper.AddPoint(SuccessfullCrossoversRowName + ComparisonFactorParameter.Value.ElementAt(i).Value.ToString(), success[i]);241 successHelper.AddPoint(SuccessfullCrossoversRowName + ComparisonFactorParameter.Value.ElementAt(i).Value.ToString(), (double)success[i] / (cnt - 1)); 242 242 } 243 243 -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
r9045 r9150 58 58 get { return (ILookupParameter<ItemCollection<IItem>>)Parameters["Operators"]; } 59 59 } 60 public IValueLookupParameter<BoolValue> MaximizationParameter { 61 get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; } 62 } 60 63 public IValueParameter<ISingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter { 61 64 get { return (IValueParameter<ISingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; } … … 70 73 71 74 [Storable] 75 private DataTableHelper successHelper; 76 [Storable] 72 77 private ScatterPlotHelper diversityPlotHelper, qualityPlotHelper; 73 78 [Storable] 74 private int cnt = 0, lastGeneration = 0 ;79 private int cnt = 0, lastGeneration = 0, success = 0; 75 80 76 81 [StorableConstructor] … … 80 85 diversityPlotHelper = (ScatterPlotHelper)original.diversityPlotHelper.Clone(cloner); 81 86 qualityPlotHelper = (ScatterPlotHelper)original.qualityPlotHelper.Clone(cloner); 87 successHelper = (DataTableHelper)original.successHelper.Clone(cloner); 82 88 cnt = original.cnt; 83 89 lastGeneration = original.lastGeneration; 90 success = original.success; 84 91 } 85 92 … … 103 110 Parameters.Add(new ValueParameter<ISingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator")); 104 111 Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.")); 112 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise")); 105 113 106 114 diversityPlotHelper = new ScatterPlotHelper(false, true); 107 qualityPlotHelper = new ScatterPlotHelper(false, true); 115 qualityPlotHelper = new ScatterPlotHelper(false, true, true); 116 successHelper = new DataTableHelper(); 108 117 } 109 118 … … 118 127 qualityPlotHelper.InitializePlot(Results, "Mutation Quality", "Solution Index", "Absolut Quality Difference"); 119 128 diversityPlotHelper.InitializePlot(Results, "Mutation Diversity", "Solution Index", "Diversity"); 129 successHelper.InitializeChart(Results, "Successfull Mutations", new string[] { "Successfull Mutations per Generation" }); 120 130 Reset(); 121 131 } … … 138 148 curPoint = new Point2D<double>(cnt++, qualityCX - qualityM); 139 149 140 141 150 string curGenStr = GenerationsParameter.ActualValue.Value.ToString(); 142 151 … … 144 153 diversityPlotHelper.AddPoint(curGenStr, divPoint); 145 154 155 if (GenerationsParameter.ActualValue.Value == lastGeneration) { 156 CountSuccess(qualityCX, qualityM); 157 } 158 146 159 if (GenerationsParameter.ActualValue.Value != 0) { 147 160 if (GenerationsParameter.ActualValue.Value > lastGeneration) { 161 successHelper.AddPoint((double)success / (cnt - 1)); 162 148 163 Reset(); 164 CountSuccess(qualityCX, qualityM); 149 165 } 150 166 } … … 156 172 cnt = 0; 157 173 lastGeneration = GenerationsParameter.ActualValue.Value; 174 success = 0; 158 175 } 159 176 … … 162 179 diversityPlotHelper.CleanUp(); 163 180 } 181 182 private void CountSuccess(double qualityCX, double qualityM) { 183 if (!MaximizationParameter.ActualValue.Value && qualityCX > qualityM) { 184 success++; 185 } 186 187 if (MaximizationParameter.ActualValue.Value && qualityCX < qualityM) { 188 success++; 189 } 190 } 164 191 } 165 192 }
Note: See TracChangeset
for help on using the changeset viewer.