Changeset 6013 for branches/histogram
- Timestamp:
- 04/15/11 19:33:28 (14 years ago)
- 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 124 124 <DependentUpon>AlleleFrequencyCollectionView.cs</DependentUpon> 125 125 </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>132 126 <Compile Include="DataRowVisualPropertiesControl.cs"> 133 127 <SubType>UserControl</SubType> … … 148 142 <DependentUpon>DataTableVisualPropertiesDialog.cs</DependentUpon> 149 143 </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>156 144 <Compile Include="HeatMapHistoryView.cs"> 157 145 <SubType>UserControl</SubType> … … 184 172 <Compile Include="AlleleFrequencyCollectionHistoryView.Designer.cs"> 185 173 <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>192 174 </Compile> 193 175 <Compile Include="Properties\AssemblyInfo.cs" /> … … 271 253 </ItemGroup> 272 254 <ItemGroup> 273 <EmbeddedResource Include="AggregatedHistogramHistoryView.resx">274 <DependentUpon>AggregatedHistogramHistoryView.cs</DependentUpon>275 </EmbeddedResource>276 255 <EmbeddedResource Include="DataRowVisualPropertiesControl.resx"> 277 256 <DependentUpon>DataRowVisualPropertiesControl.cs</DependentUpon> … … 288 267 <EmbeddedResource Include="HeatMapView.resx"> 289 268 <DependentUpon>HeatMapView.cs</DependentUpon> 290 </EmbeddedResource>291 <EmbeddedResource Include="HistogramView.resx">292 <DependentUpon>HistogramView.cs</DependentUpon>293 269 </EmbeddedResource> 294 270 </ItemGroup> -
branches/histogram/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r5994 r6013 118 118 <Compile Include="AlleleFrequencyAnalysis\AlleleFrequencyCollectionHistory.cs" /> 119 119 <Compile Include="BestScopeSolutionAnalyzer.cs" /> 120 <Compile Include="DataVisualization\HistogramHistory.cs" />121 120 <Compile Include="DataVisualization\DataRow.cs" /> 122 121 <Compile Include="DataVisualization\DataRowVisualProperties.cs" /> … … 127 126 <Compile Include="DataVisualization\HeatMap.cs" /> 128 127 <Compile Include="DataVisualization\HeatMapHistory.cs" /> 129 <Compile Include="DataVisualization\Histogram.cs" />130 128 <Compile Include="MultidimensionalScaling\MultidimensionalScaling.cs" /> 131 129 <Compile Include="MultiObjective\RankBasedParetoFrontAnalyzer.cs" /> -
branches/histogram/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityDistributionAnalyzer.cs
r5994 r6013 30 30 31 31 namespace HeuristicLab.Analysis.QualityAnalysis { 32 [Item("Quality DistributionAnalyzer", "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.")] 33 33 [StorableClass] 34 public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer {34 public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer, IIterationBasedOperator { 35 35 36 36 #region Parameter properties … … 41 41 get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; } 42 42 } 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"]; } 45 54 } 46 55 #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 } 47 66 48 67 [StorableConstructor] … … 55 74 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution.")); 56 75 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; 58 85 } 59 86 … … 63 90 64 91 public override IOperation Apply() { 65 HistogramHistoryqualityDistribution = null;92 DataTable qualityDistribution = null; 66 93 ResultCollection results = ResultsParameter.ActualValue; 67 94 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; 71 97 } 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)); 74 102 } 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 } 76 109 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)); 80 112 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 } 81 133 return base.Apply(); 82 134 } -
branches/histogram/HistogramViewTest/Form1.cs
r5961 r6013 6 6 namespace HistogramViewTest { 7 7 public partial class Form1 : Form { 8 private HistogramView view;8 private DataTableView view; 9 9 10 10 public Form1() { 11 11 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; 14 16 Random rand = new Random(); 15 17 for (int index = 1; index < 100; index++) { 16 hist.Values.Add(rand.Next(1, 1000));18 row.Values.Add(rand.Next(1, 1000)); 17 19 } 20 hist.Rows.Add(row); 18 21 view.Content = hist; 22 view.Dock = DockStyle.Fill; 19 23 Controls.Add(view); 20 24 } -
branches/histogram/HistogramViewTest/HistogramViewTest.csproj
r5961 r6013 102 102 <Name>HeuristicLab.Core-3.3</Name> 103 103 </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> 104 108 <ProjectReference Include="..\HeuristicLab.MainForm.WindowsForms\3.3\HeuristicLab.MainForm.WindowsForms-3.3.csproj"> 105 109 <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
Note: See TracChangeset
for help on using the changeset viewer.