Changeset 9059
- Timestamp:
- 12/14/12 16:03:28 (12 years ago)
- Location:
- branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/DataTableHelper.cs
r8797 r9059 20 20 #endregion 21 21 22 using System.Collections.Generic;22 using HeuristicLab.Collections; 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; … … 75 75 dt.Rows[dataRowNames[0]].Values.Add(point); 76 76 } 77 78 public ObservableList<double> GetFirstDataRow() { 79 return dt.Rows[dataRowNames[0]].Values; 80 } 77 81 } 78 82 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ScatterPlotHelper.cs
r8867 r9059 45 45 public bool CreateDataTable { get; set; } 46 46 [Storable] 47 public DataTableHelper dataTableHelper ;47 public DataTableHelper dataTableHelper, minMaxDataTableHelper; 48 48 [Storable] 49 49 private string lastRowName; 50 [Storable] 51 private bool trackMinMaxValues; 52 [Storable] 53 private double min; 54 [Storable] 55 private double max; 56 [Storable] 57 private ResultCollection Results; 50 58 51 59 [Storable] … … 68 76 StoreHistory = true; 69 77 CreateDataTable = false; 78 min = double.MaxValue; 79 max = double.MinValue; 70 80 } 71 81 72 public ScatterPlotHelper(bool storeHistory, bool createDataTable )82 public ScatterPlotHelper(bool storeHistory, bool createDataTable, bool trackMinMax = false) 73 83 : base() { 74 84 StoreHistory = storeHistory; 75 85 CreateDataTable = createDataTable; 86 trackMinMaxValues = trackMinMax; 87 min = double.MaxValue; 88 max = double.MinValue; 76 89 } 77 90 … … 81 94 82 95 public void InitializePlot(ResultCollection results, string chartName, string xAxisTitle, string yAxisTitle) { 96 Results = results; 83 97 if (CreateDataTable) { 84 98 if (dataTableHelper == null) { 85 99 dataTableHelper = new DataTableHelper(); 100 minMaxDataTableHelper = new DataTableHelper(); 86 101 } 87 102 dataTableHelper.InitializeChart(results, chartName + " Chart", new string[] { yAxisTitle }); 103 88 104 } 89 105 … … 104 120 105 121 public void AddPoint(string rowName, Point2D<double> point) { 122 if (point.Y > max) 123 max = point.Y; 124 if (point.Y < min) 125 min = point.Y; 126 106 127 if (!Plot.Rows.ContainsKey(rowName)) { 107 128 if (StoreHistory) … … 135 156 136 157 public void CleanUp() { 158 if (CreateDataTable && trackMinMaxValues) { 159 minMaxDataTableHelper.InitializeChart(Results, chartName + " Scaled Chart", new string[] { yAxisTitle }); 160 dataTableHelper.GetFirstDataRow().ForEach(x => minMaxDataTableHelper.AddPoint((x - min) / (max - min))); 161 } 162 137 163 if (!StoreHistory && CreateDataTable) { 138 164 resultsCol[chartName].Value = null; -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/SolutionToPopulationAnalyzer.cs
r9058 r9059 101 101 102 102 populationDiversityPlot = new ScatterPlotHelper(false, true); 103 populationQualityPlot = new ScatterPlotHelper(false, true );104 qualityPlot = new ScatterPlotHelper(false, true );103 populationQualityPlot = new ScatterPlotHelper(false, true, true); 104 qualityPlot = new ScatterPlotHelper(false, true, true); 105 105 } 106 106
Note: See TracChangeset
for help on using the changeset viewer.