Changeset 9058 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers
- Timestamp:
- 12/14/12 15:12:56 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/SolutionToPopulationAnalyzer.cs
r9054 r9058 38 38 39 39 #region Parameter properties 40 public IValueLookupParameter<BoolValue> MaximizationParameter { 41 get { return (IValueLookupParameter<BoolValue>)Parameters["Maximization"]; } 42 } 40 43 public ILookupParameter<ResultCollection> ResultsParameter { 41 44 get { return (ILookupParameter<ResultCollection>)Parameters[ResultsParameterName]; } … … 66 69 } 67 70 [Storable] 68 private ScatterPlotHelper populationDiversityPlot, populationQualityPlot ;71 private ScatterPlotHelper populationDiversityPlot, populationQualityPlot, qualityPlot; 69 72 [Storable] 70 73 private int cnt = 0; … … 81 84 populationDiversityPlot = (ScatterPlotHelper)populationDiversityPlot.Clone(cloner); 82 85 populationQualityPlot = (ScatterPlotHelper)populationQualityPlot.Clone(cloner); 86 qualityPlot = (ScatterPlotHelper)qualityPlot.Clone(cloner); 83 87 } 84 88 … … 94 98 Parameters.Add(new ValueParameter<StringValue>("ChartPostfix", new StringValue(string.Empty))); 95 99 Parameters.Add(new LookupParameter<ItemCollection<IItem>>("Operators", "The operators and items that the problem provides to the algorithms.")); 100 Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem, false otherwise")); 96 101 97 102 populationDiversityPlot = new ScatterPlotHelper(false, true); 98 103 populationQualityPlot = new ScatterPlotHelper(false, true); 104 qualityPlot = new ScatterPlotHelper(false, true); 99 105 } 100 106 … … 110 116 populationDiversityPlot.InitializePlot(Results, "Solution to Population Diversity " + ChartPostfixParameter.Value.Value, "Solution Index", "Diversity"); 111 117 populationQualityPlot.InitializePlot(Results, "Solution Quality Difference to Population " + ChartPostfixParameter.Value.Value, "Solution Index", "Quality Difference"); 118 qualityPlot.InitializePlot(Results, "Solution Quality " + ChartPostfixParameter.Value.Value, "Solution Index", "Quality"); 112 119 113 120 Reset(); … … 147 154 } 148 155 149 var diversityPoint = new Point2D<double>(cnt++, solToPopDiversity / popSize); 150 var qualityPoint = new Point2D<double>(cnt, Math.Abs((oldPopQuality / popSize) - quality)); 156 Point2D<double> popQualityPoint; 157 if (MaximizationParameter.ActualValue.Value) { 158 popQualityPoint = new Point2D<double>(cnt, quality - (oldPopQuality / popSize)); 159 } else { 160 popQualityPoint = new Point2D<double>(cnt, (oldPopQuality / popSize) - quality); 161 } 162 163 Point2D<double> solQuality = new Point2D<double>(cnt, quality); 164 Point2D<double> diversityPoint = new Point2D<double>(cnt++, solToPopDiversity / popSize); 151 165 152 166 populationDiversityPlot.AddPoint(curGenStr, diversityPoint); 153 populationQualityPlot.AddPoint(curGenStr, qualityPoint); 167 populationQualityPlot.AddPoint(curGenStr, popQualityPoint); 168 qualityPlot.AddPoint(curGenStr, solQuality); 154 169 } 155 170 … … 165 180 populationQualityPlot.CleanUp(); 166 181 populationDiversityPlot.CleanUp(); 182 qualityPlot.CleanUp(); 167 183 } 168 184
Note: See TracChangeset
for help on using the changeset viewer.