Changeset 15720
- Timestamp:
- 02/04/18 21:34:23 (7 years ago)
- Location:
- branches/1614_GeneralizedQAP
- Files:
-
- 5 edited
- 5 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/1614_GeneralizedQAP/HeuristicLab.Analysis
- Property svn:mergeinfo changed
-
branches/1614_GeneralizedQAP/HeuristicLab.Analysis.Views
- Property svn:mergeinfo changed
-
branches/1614_GeneralizedQAP/HeuristicLab.Analysis.Views/3.3/HeatMapView.resx
- Property svn:mergeinfo changed
/branches/PerformanceComparison/HeuristicLab.Analysis.Views/3.3/HeatMapView.resx (added) merged: 15282,15330
- Property svn:mergeinfo changed
-
branches/1614_GeneralizedQAP/HeuristicLab.Analysis/3.3/HeuristicLab.Analysis-3.3.csproj
r15719 r15720 170 170 <Compile Include="AlleleFrequencyAnalysis\AlleleFrequencyCollection.cs" /> 171 171 <Compile Include="AlleleFrequencyAnalysis\AlleleFrequencyCollectionHistory.cs" /> 172 <Compile Include="BestNScopesSolutionAnalyzer.cs" /> 172 173 <Compile Include="BestScopeSolutionAnalyzer.cs" /> 173 174 <Compile Include="DataVisualization\GanttData.cs" /> 175 <Compile Include="Clustering\CkMeans1D.cs"> 176 <SubType>Code</SubType> 177 </Compile> 178 <Compile Include="Clustering\ClusterHelper.cs" /> 174 179 <Compile Include="DataVisualization\IndexedDataRow.cs" /> 175 180 <Compile Include="DataVisualization\IndexedDataTable.cs" /> … … 190 195 <Compile Include="MultiObjective\RankBasedParetoFrontAnalyzer.cs" /> 191 196 <Compile Include="MultiObjective\ParetoFrontAnalyzer.cs" /> 197 <Compile Include="Optimizers\IteratedAlgorithm.cs" /> 192 198 <Compile Include="Plugin.cs" /> 193 199 <Compile Include="PopulationSimilarityAnalysis\PopulationDiversityAnalyzer.cs" /> … … 206 212 <Compile Include="QualityAnalysis\QualityPerEvaluationsAnalyzer.cs" /> 207 213 <Compile Include="QualityAnalysis\ScaledQualityDifferenceAnalyzer.cs" /> 214 <Compile Include="SelfOrganizingMaps\RelationalSOM.cs" /> 215 <Compile Include="SelfOrganizingMaps\SOM.cs" /> 208 216 <Compile Include="Statistics\BonferroniHolm.cs" /> 209 217 <Compile Include="Statistics\EnumerableStatisticsExtension.cs" /> -
branches/1614_GeneralizedQAP/HeuristicLab.Analysis/3.3/QualityAnalysis/QualityDistributionAnalyzer.cs
r15583 r15720 20 20 #endregion 21 21 22 using System.Linq;23 22 using HeuristicLab.Common; 24 23 using HeuristicLab.Core; … … 28 27 using HeuristicLab.Parameters; 29 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 using System.Collections.Generic; 30 using System.Linq; 30 31 31 32 namespace HeuristicLab.Analysis.QualityAnalysis { … … 33 34 [StorableClass] 34 35 public class QualityDistributionAnalyzer : SingleSuccessorOperator, IAnalyzer, IIterationBasedOperator, ISingleObjectiveOperator { 36 private const string TableDescription = "Shows the quality distributions in the current population."; 35 37 36 38 #region Parameter properties … … 93 95 } 94 96 97 public static DataTable PrepareTable(string qualityName = "Quality") { 98 var result = new DataTable("Population Quality Distribution", TableDescription); 99 result.VisualProperties.XAxisTitle = qualityName; 100 result.VisualProperties.YAxisTitle = "Frequency"; 101 102 var row = new DataRow("QualityDistribution"); 103 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 104 result.Rows.Add(row); 105 106 return result; 107 } 108 109 public static void UpdateTable(DataTable table, IEnumerable<double> qualities) { 110 var row = table.Rows["QualityDistribution"]; 111 row.Values.Replace(qualities); 112 } 113 95 114 public override IOperation Apply() { 96 115 DataTable qualityDistribution = null; 97 ResultCollection results = ResultsParameter.ActualValue; 98 string description = "Shows the quality distributions in the current population."; 116 var results = ResultsParameter.ActualValue; 99 117 if (results.ContainsKey(HistogramName)) { 100 qualityDistribution = results[HistogramName].Value as DataTable;118 qualityDistribution = (DataTable)results[HistogramName].Value; 101 119 } else { 102 qualityDistribution = new DataTable("Population Quality Distribution", description); 103 qualityDistribution.VisualProperties.XAxisTitle = QualityParameter.ActualName; 104 qualityDistribution.VisualProperties.YAxisTitle = "Frequency"; 105 results.Add(new Result(HistogramName, description, qualityDistribution)); 120 qualityDistribution = PrepareTable(QualityParameter.ActualName); 121 results.Add(new Result(HistogramName, TableDescription, qualityDistribution)); 106 122 } 107 DataRow row; 108 if (!qualityDistribution.Rows.TryGetValue("QualityDistribution", out row)) { 109 row = new DataRow("QualityDistribution"); 110 row.VisualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Histogram; 111 qualityDistribution.Rows.Add(row); 112 } 113 var qualities = QualityParameter.ActualValue; 114 row.Values.Replace(qualities.Select(x => x.Value)); 123 124 UpdateTable(qualityDistribution, QualityParameter.ActualValue.Select(x => x.Value)); 115 125 116 126 if (StoreHistory) { 117 stringhistoryResultName = HistogramName + " History";127 var historyResultName = HistogramName + " History"; 118 128 DataTableHistory qdHistory = null; 119 129 if (results.ContainsKey(historyResultName)) { 120 qdHistory = results[historyResultName].Value as DataTableHistory;130 qdHistory = (DataTableHistory)results[historyResultName].Value; 121 131 } else { 122 132 qdHistory = new DataTableHistory(); 123 133 results.Add(new Result(historyResultName, qdHistory)); 124 134 } 125 DataTabletable = (DataTable)qualityDistribution.Clone();126 IntValueiteration = IterationsParameter.ActualValue;135 var table = (DataTable)qualityDistribution.Clone(); 136 var iteration = IterationsParameter.ActualValue; 127 137 if (iteration != null) { 128 stringiterationName = IterationsParameter.ActualName;138 var iterationName = IterationsParameter.ActualName; 129 139 if (iterationName.EndsWith("s")) iterationName = iterationName.Remove(iterationName.Length - 1); 130 stringappendix = " at " + iterationName + " " + iteration.Value.ToString();140 var appendix = " at " + iterationName + " " + iteration.Value.ToString(); 131 141 table.Name += appendix; 132 142 table.Rows["QualityDistribution"].VisualProperties.DisplayName += appendix;
Note: See TracChangeset
for help on using the changeset viewer.