Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6013 for branches/histogram


Ignore:
Timestamp:
04/15/11 19:33:28 (14 years ago)
Author:
abeham
Message:

#1465

  • removed AggregatedHistogramHistoryView
  • removed Histogram and HistogramHistory data structures
  • removed HistogramView and HistogramHistoryView, but left the HistogramControl
  • adapted the QualityDistributionAnalyzer to create a DataTable instead
  • added a StoreHistory parameter
  • adapted the temporary test project
Location:
branches/histogram
Files:
10 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram/HeuristicLab.Analysis.Views/3.3/HeuristicLab.Analysis.Views-3.3.csproj

    r6012 r6013  
    124124      <DependentUpon>AlleleFrequencyCollectionView.cs</DependentUpon>
    125125    </Compile>
    126     <Compile Include="AggregatedHistogramHistoryView.cs">
    127       <SubType>UserControl</SubType>
    128     </Compile>
    129     <Compile Include="AggregatedHistogramHistoryView.Designer.cs">
    130       <DependentUpon>AggregatedHistogramHistoryView.cs</DependentUpon>
    131     </Compile>
    132126    <Compile Include="DataRowVisualPropertiesControl.cs">
    133127      <SubType>UserControl</SubType>
     
    148142      <DependentUpon>DataTableVisualPropertiesDialog.cs</DependentUpon>
    149143    </Compile>
    150     <Compile Include="HistogramHistoryView.cs">
    151       <SubType>UserControl</SubType>
    152     </Compile>
    153     <Compile Include="HistogramHistoryView.Designer.cs">
    154       <DependentUpon>HistogramHistoryView.cs</DependentUpon>
    155     </Compile>
    156144    <Compile Include="HeatMapHistoryView.cs">
    157145      <SubType>UserControl</SubType>
     
    184172    <Compile Include="AlleleFrequencyCollectionHistoryView.Designer.cs">
    185173      <DependentUpon>AlleleFrequencyCollectionHistoryView.cs</DependentUpon>
    186     </Compile>
    187     <Compile Include="HistogramView.cs">
    188       <SubType>UserControl</SubType>
    189     </Compile>
    190     <Compile Include="HistogramView.Designer.cs">
    191       <DependentUpon>HistogramView.cs</DependentUpon>
    192174    </Compile>
    193175    <Compile Include="Properties\AssemblyInfo.cs" />
     
    271253  </ItemGroup>
    272254  <ItemGroup>
    273     <EmbeddedResource Include="AggregatedHistogramHistoryView.resx">
    274       <DependentUpon>AggregatedHistogramHistoryView.cs</DependentUpon>
    275     </EmbeddedResource>
    276255    <EmbeddedResource Include="DataRowVisualPropertiesControl.resx">
    277256      <DependentUpon>DataRowVisualPropertiesControl.cs</DependentUpon>
     
    288267    <EmbeddedResource Include="HeatMapView.resx">
    289268      <DependentUpon>HeatMapView.cs</DependentUpon>
    290     </EmbeddedResource>
    291     <EmbeddedResource Include="HistogramView.resx">
    292       <DependentUpon>HistogramView.cs</DependentUpon>
    293269    </EmbeddedResource>
    294270  </ItemGroup>
  • branches/histogram/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj

    r5994 r6013  
    118118    <Compile Include="AlleleFrequencyAnalysis\AlleleFrequencyCollectionHistory.cs" />
    119119    <Compile Include="BestScopeSolutionAnalyzer.cs" />
    120     <Compile Include="DataVisualization\HistogramHistory.cs" />
    121120    <Compile Include="DataVisualization\DataRow.cs" />
    122121    <Compile Include="DataVisualization\DataRowVisualProperties.cs" />
     
    127126    <Compile Include="DataVisualization\HeatMap.cs" />
    128127    <Compile Include="DataVisualization\HeatMapHistory.cs" />
    129     <Compile Include="DataVisualization\Histogram.cs" />
    130128    <Compile Include="MultidimensionalScaling\MultidimensionalScaling.cs" />
    131129    <Compile Include="MultiObjective\RankBasedParetoFrontAnalyzer.cs" />
  • branches/histogram/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityDistributionAnalyzer.cs

    r5994 r6013  
    3030
    3131namespace HeuristicLab.Analysis.QualityAnalysis {
    32   [Item("Quality Distribution Analyzer", "Analyzes the distribution of the quality values in that it adds a Histogram of them into the result collection.")]
     32  [Item("QualityDistributionAnalyzer", "Analyzes the distribution of the quality values in that it adds a Histogram of them into the result collection.")]
    3333  [StorableClass]
    34   public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer {
     34  public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer, IIterationBasedOperator {
    3535
    3636    #region Parameter properties
     
    4141      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    4242    }
    43     public IValueParameter<StringValue> HistogramNameParameter {
    44       get { return (IValueParameter<StringValue>)Parameters["HistogramName"]; }
     43    private ValueParameter<StringValue> HistogramNameParameter {
     44      get { return (ValueParameter<StringValue>)Parameters["HistogramName"]; }
     45    }
     46    private ValueParameter<BoolValue> StoreHistoryParameter {
     47      get { return (ValueParameter<BoolValue>)Parameters["StoreHistory"]; }
     48    }
     49    public ILookupParameter<IntValue> IterationsParameter {
     50      get { return (ILookupParameter<IntValue>)Parameters["Iterations"]; }
     51    }
     52    public IValueLookupParameter<IntValue> MaximumIterationsParameter {
     53      get { return (IValueLookupParameter<IntValue>)Parameters["MaximumIterations"]; }
    4554    }
    4655    #endregion
     56
     57    public string HistogramName {
     58      get { return HistogramNameParameter.Value.Value; }
     59      set { HistogramNameParameter.Value.Value = value; }
     60    }
     61
     62    public bool StoreHistory {
     63      get { return StoreHistoryParameter.Value.Value; }
     64      set { StoreHistoryParameter.Value.Value = value; }
     65    }
    4766
    4867    [StorableConstructor]
     
    5574      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
    5675      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The results collection where the analysis values should be stored."));
    57       Parameters.Add(new ValueParameter<StringValue>("HistogramName", "The name of the histogram that gets injected in to the results collection.", new StringValue("QualityDistribution")));
     76      Parameters.Add(new FixedValueParameter<StringValue>("HistogramName", "The name of the histogram that gets injected in to the results collection.", new StringValue("Quality Distribution")));
     77      Parameters.Add(new FixedValueParameter<BoolValue>("StoreHistory", "True if the history should be stored in addition to the current distribution", new BoolValue(false)));
     78      Parameters.Add(new LookupParameter<IntValue>("Iterations", "Optional: A value indicating the current iteration."));
     79      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "Unused", new IntValue(-1)));
     80
     81      QualityParameter.Hidden = true;
     82      ResultsParameter.Hidden = true;
     83      IterationsParameter.Hidden = true;
     84      MaximumIterationsParameter.Hidden = true;
    5885    }
    5986
     
    6390
    6491    public override IOperation Apply() {
    65       HistogramHistory qualityDistribution = null;
     92      DataTable qualityDistribution = null;
    6693      ResultCollection results = ResultsParameter.ActualValue;
    6794      string description = "Shows the quality distributions in the current population.";
    68       string resultName = HistogramNameParameter.Value.Value;
    69       if (results.ContainsKey(resultName)) {
    70         qualityDistribution = results[resultName].Value as HistogramHistory;
     95      if (results.ContainsKey(HistogramName)) {
     96        qualityDistribution = results[HistogramName].Value as DataTable;
    7197      } else {
    72         qualityDistribution = new HistogramHistory();
    73         results.Add(new Result(resultName, description, qualityDistribution));
     98        qualityDistribution = new DataTable("Population Quality Distribution", description);
     99        qualityDistribution.VisualProperties.XAxisTitle = IterationsParameter.ActualName;
     100        qualityDistribution.VisualProperties.YAxisTitle = QualityParameter.ActualName;
     101        results.Add(new Result(HistogramName, description, qualityDistribution));
    74102      }
    75       Histogram histogram = new Histogram("History " + qualityDistribution.Count, description);
     103      DataRow row;
     104      if (!qualityDistribution.Rows.TryGetValue("QualityDistribution", out row)) {
     105        row = new DataRow("QualityDistribution");
     106        row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
     107        qualityDistribution.Rows.Add(row);
     108      }
    76109      var qualities = QualityParameter.ActualValue;
    77       histogram.Values.Clear();
    78       histogram.Values.AddRange(qualities.Select(x => x.Value));
    79       qualityDistribution.Add(histogram);
     110      row.Values.Clear();
     111      row.Values.AddRange(qualities.Select(x => x.Value));
    80112
     113      if (StoreHistory) {
     114        string historyResultName = HistogramName + " History";
     115        DataTableHistory qdHistory = null;
     116        if (results.ContainsKey(historyResultName)) {
     117          qdHistory = results[historyResultName].Value as DataTableHistory;
     118        } else {
     119          qdHistory = new DataTableHistory();
     120          results.Add(new Result(historyResultName, qdHistory));
     121        }
     122        DataTable table = (DataTable)qualityDistribution.Clone();
     123        IntValue iteration = IterationsParameter.ActualValue;
     124        if (iteration != null) {
     125          string iterationName = IterationsParameter.ActualName;
     126          if (iterationName.EndsWith("s")) iterationName = iterationName.Remove(iterationName.Length - 1);
     127          string appendix = " at " + iterationName + " " + iteration.Value.ToString();
     128          table.Name += appendix;
     129          table.Rows["QualityDistribution"].Name += appendix;
     130        }
     131        qdHistory.Add(table);
     132      }
    81133      return base.Apply();
    82134    }
  • branches/histogram/HistogramViewTest/Form1.cs

    r5961 r6013  
    66namespace HistogramViewTest {
    77  public partial class Form1 : Form {
    8     private HistogramView view;
     8    private DataTableView view;
    99
    1010    public Form1() {
    1111      InitializeComponent();
    12       view = new HistogramView();
    13       Histogram hist = new Histogram();
     12      view = new DataTableView();
     13      DataTable hist = new DataTable("TestTable");
     14      DataRow row = new DataRow("Test");
     15      row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram;
    1416      Random rand = new Random();
    1517      for (int index = 1; index < 100; index++) {
    16         hist.Values.Add(rand.Next(1, 1000));
     18        row.Values.Add(rand.Next(1, 1000));
    1719      }
     20      hist.Rows.Add(row);
    1821      view.Content = hist;
     22      view.Dock = DockStyle.Fill;
    1923      Controls.Add(view);
    2024    }
  • branches/histogram/HistogramViewTest/HistogramViewTest.csproj

    r5961 r6013  
    102102      <Name>HeuristicLab.Core-3.3</Name>
    103103    </ProjectReference>
     104    <ProjectReference Include="..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
     105      <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
     106      <Name>HeuristicLab.Data-3.3</Name>
     107    </ProjectReference>
    104108    <ProjectReference Include="..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj">
    105109      <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
Note: See TracChangeset for help on using the changeset viewer.