Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/14/12 16:03:28 (12 years ago)
Author:
ascheibe
Message:

#1886 track min and max quality values for scaling

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  
    2020#endregion
    2121
    22 using System.Collections.Generic;
     22using HeuristicLab.Collections;
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     
    7575      dt.Rows[dataRowNames[0]].Values.Add(point);
    7676    }
     77
     78    public ObservableList<double> GetFirstDataRow() {
     79      return dt.Rows[dataRowNames[0]].Values;
     80    }
    7781  }
    7882}
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/ScatterPlotHelper.cs

    r8867 r9059  
    4545    public bool CreateDataTable { get; set; }
    4646    [Storable]
    47     public DataTableHelper dataTableHelper;
     47    public DataTableHelper dataTableHelper, minMaxDataTableHelper;
    4848    [Storable]
    4949    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;
    5058
    5159    [Storable]
     
    6876      StoreHistory = true;
    6977      CreateDataTable = false;
     78      min = double.MaxValue;
     79      max = double.MinValue;
    7080    }
    7181
    72     public ScatterPlotHelper(bool storeHistory, bool createDataTable)
     82    public ScatterPlotHelper(bool storeHistory, bool createDataTable, bool trackMinMax = false)
    7383      : base() {
    7484      StoreHistory = storeHistory;
    7585      CreateDataTable = createDataTable;
     86      trackMinMaxValues = trackMinMax;
     87      min = double.MaxValue;
     88      max = double.MinValue;
    7689    }
    7790
     
    8194
    8295    public void InitializePlot(ResultCollection results, string chartName, string xAxisTitle, string yAxisTitle) {
     96      Results = results;
    8397      if (CreateDataTable) {
    8498        if (dataTableHelper == null) {
    8599          dataTableHelper = new DataTableHelper();
     100          minMaxDataTableHelper = new DataTableHelper();
    86101        }
    87102        dataTableHelper.InitializeChart(results, chartName + " Chart", new string[] { yAxisTitle });
     103
    88104      }
    89105
     
    104120
    105121    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
    106127      if (!Plot.Rows.ContainsKey(rowName)) {
    107128        if (StoreHistory)
     
    135156
    136157    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
    137163      if (!StoreHistory && CreateDataTable) {
    138164        resultsCol[chartName].Value = null;
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/SolutionToPopulationAnalyzer.cs

    r9058 r9059  
    101101
    102102      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);
    105105    }
    106106
Note: See TracChangeset for help on using the changeset viewer.