Changeset 9384
- Timestamp:
- 04/19/13 13:47:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/SelectionPressureAnalyzer.cs
r9341 r9384 22 22 23 23 using System; 24 using System.Collections.Generic; 24 25 using System.Linq; 25 26 using HeuristicLab.Common; … … 65 66 } 66 67 [Storable] 67 private ScatterPlotHelper selPressurePlot ;68 private ScatterPlotHelper selPressurePlot, selIntensityPlot; 68 69 [Storable] 69 70 private int cnt = 0; … … 79 80 lastGeneration = original.lastGeneration; 80 81 selPressurePlot = (ScatterPlotHelper)original.selPressurePlot.Clone(cloner); 82 selIntensityPlot = (ScatterPlotHelper)original.selIntensityPlot.Clone(cloner); 81 83 SolutionQualityName = original.SolutionQualityName; 82 84 } … … 93 95 94 96 selPressurePlot = new ScatterPlotHelper(false, true, true, true); 97 selIntensityPlot = new ScatterPlotHelper(false, true, true, true); 95 98 } 96 99 … … 101 104 protected override void InitializeAction() { 102 105 selPressurePlot.InitializePlot(Results, "Selection Pressure", "Solution Index", "Quality Difference"); 106 selIntensityPlot.InitializePlot(Results, "Selection Intensity", "Solution Index", "Scaled Quality Difference"); 103 107 ParentsQualityParameter.ActualName = SolutionQualityName; 104 108 … … 121 125 122 126 double oldPopQuality = 0.0; 127 List<double> qValues = new List<double>(); 123 128 int popSize = 0; 124 129 foreach (IScope oldSolScope in oldPop.SubScopes) { 125 130 double curQuality = ((DoubleValue)oldSolScope.Variables[SolutionQualityName].Value).Value; 126 131 oldPopQuality += curQuality; 132 qValues.Add(curQuality); 127 133 popSize++; 128 134 } … … 138 144 selPressurePlot.Max = bkQuality - wkQuality; 139 145 selPressurePlot.Min = 0; 146 selIntensityPlot.Max = bkQuality - wkQuality; 147 selIntensityPlot.Min = 0; 140 148 } 141 149 } else { … … 143 151 selPressurePlot.Max = wkQuality - bkQuality; 144 152 selPressurePlot.Min = 0; 153 selIntensityPlot.Max = wkQuality - bkQuality; 154 selIntensityPlot.Min = 0; 145 155 } 146 156 } 147 157 } 148 158 149 Point2D<double> popQualityPoint ;159 Point2D<double> popQualityPoint, selectionIntensityPoint; 150 160 if (MaximizationParameter.ActualValue.Value) { 151 161 popQualityPoint = new Point2D<double>(cnt, quality - (oldPopQuality / popSize)); 162 selectionIntensityPoint = new Point2D<double>(cnt, (quality - (oldPopQuality / popSize) / qValues.StandardDeviation())); 152 163 } else { 153 164 popQualityPoint = new Point2D<double>(cnt, (oldPopQuality / popSize) - quality); 165 selectionIntensityPoint = new Point2D<double>(cnt, ((oldPopQuality / popSize) - quality) / qValues.StandardDeviation()); 154 166 } 155 167 156 168 selPressurePlot.AddPoint(curGenStr, popQualityPoint); 169 selIntensityPlot.AddPoint(curGenStr, selectionIntensityPoint); 157 170 } 158 171 … … 167 180 public override void ClearState() { 168 181 selPressurePlot.CleanUp(); 182 selIntensityPlot.CleanUp(); 169 183 } 170 184
Note: See TracChangeset
for help on using the changeset viewer.