Changeset 8511
- Timestamp:
- 08/21/12 13:32:05 (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/CrossoverPerformanceAnalyzer.cs
r8505 r8511 128 128 Parameters.Add(new ValueParameter<SingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator")); 129 129 130 plotHelper = new ScatterPlotHelper( );131 childDiversityHelper = new ScatterPlotHelper( );132 parentDiversityHelper = new ScatterPlotHelper( );130 plotHelper = new ScatterPlotHelper(false, true); 131 childDiversityHelper = new ScatterPlotHelper(false, true); 132 parentDiversityHelper = new ScatterPlotHelper(false, true); 133 133 performanceHelper = new DataTableHelper(); 134 134 successHelper = new DataTableHelper(); -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/MutationPerformanceAnalyzer.cs
r8505 r8511 112 112 PermutationAfterMutationParameter.ActualName = "TSPTour"; 113 113 114 diversityPlotHelper = new ScatterPlotHelper( );115 qualityPlotHelper = new ScatterPlotHelper( );114 diversityPlotHelper = new ScatterPlotHelper(false, true); 115 qualityPlotHelper = new ScatterPlotHelper(false, true); 116 116 avgDataTableHelper = new DataTableHelper(); 117 117 } -
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ScatterPlotHelper.cs
r8505 r8511 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 23 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; … … 39 40 [Storable] 40 41 private string yAxisTitle; 42 [Storable] 43 public bool StoreHistory { get; set; } 44 [Storable] 45 public bool CreateDataTable { get; set; } 46 [Storable] 47 public DataTableHelper dataTableHelper; 48 [Storable] 49 private string lastRowName; 41 50 42 51 [Storable] … … 55 64 xAxisTitle = original.xAxisTitle; 56 65 yAxisTitle = original.yAxisTitle; 66 StoreHistory = original.StoreHistory; 57 67 plot = (ScatterPlot)original.plot.Clone(cloner); 68 CreateDataTable = original.CreateDataTable; 69 if (original.dataTableHelper != null) 70 dataTableHelper = (DataTableHelper)original.dataTableHelper.Clone(cloner); 71 lastRowName = original.lastRowName; 58 72 } 59 public ScatterPlotHelper() : base() { } 73 74 public ScatterPlotHelper() 75 : base() { 76 StoreHistory = true; 77 CreateDataTable = false; 78 } 79 80 public ScatterPlotHelper(bool storeHistory, bool createDataTable) 81 : base() { 82 StoreHistory = storeHistory; 83 CreateDataTable = createDataTable; 84 } 60 85 61 86 public override IDeepCloneable Clone(Cloner cloner) { … … 64 89 65 90 public void InitializePlot(ResultCollection results, string chartName, string xAxisTitle, string yAxisTitle) { 91 if (CreateDataTable) { 92 if (dataTableHelper == null) { 93 dataTableHelper = new DataTableHelper(); 94 } 95 dataTableHelper.InitializeChart(results, chartName + " Chart", yAxisTitle); 96 } 97 66 98 if (!results.ContainsKey(chartName)) { 67 99 this.chartName = chartName; … … 73 105 74 106 results.Add(new Result(chartName, Plot)); 75 results.Add(new Result(chartName + " History", new ScatterPlotHistory())); 107 if (StoreHistory) 108 results.Add(new Result(chartName + " History", new ScatterPlotHistory())); 76 109 } 77 110 } … … 79 112 public void AddPoint(string rowName, Point2D<double> point) { 80 113 if (!Plot.Rows.ContainsKey(rowName)) { 81 ((ScatterPlotHistory)resultsCol[chartName + " History"].Value).Add(Plot); 114 if (StoreHistory) 115 ((ScatterPlotHistory)resultsCol[chartName + " History"].Value).Add(Plot); 116 117 if (CreateDataTable && lastRowName != null && lastRowName != string.Empty) { 118 double avg = Plot.Rows[lastRowName].Points.Average(x => x.Y); 119 dataTableHelper.AddPoint(avg); 120 } 121 82 122 Initialize(); 83 123 resultsCol[chartName].Value = Plot; … … 89 129 row.VisualProperties.PointSize = 5; 90 130 Plot.Rows.Add(row); 131 lastRowName = rowName; 91 132 } else { 92 133 Plot.Rows[rowName].Points.Add(point);
Note: See TracChangeset
for help on using the changeset viewer.