Changeset 14231 for branches/HeuristicLab.OSGAEvaluator/HeuristicLab.OSGAEvaluator/OSGAPredictionCountsAnalyzer.cs
- Timestamp:
- 08/03/16 18:26:24 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.OSGAEvaluator/HeuristicLab.OSGAEvaluator/OSGAPredictionCountsAnalyzer.cs
r14104 r14231 44 44 45 45 ResultCollection predictionResults; 46 DataTable rejectedStatsTable, totalStatsTable ;46 DataTable rejectedStatsTable, totalStatsTable, rejectedStatsPerGenerationTable, nonRejectedStatsPerGenerationTable; 47 47 if (!ResultCollection.ContainsKey("OS Prediction")) { 48 48 predictionResults = new ResultCollection(); … … 57 57 } 58 58 predictionResults.Add(new Result("Total Stats", totalStatsTable)); 59 59 rejectedStatsPerGenerationTable = new DataTable("Rejected Per Generation"); 60 nonRejectedStatsPerGenerationTable = new DataTable("Non Rejected Stats per Generation"); 61 foreach (var rowName in rejectedStats.RowNames) { 62 rejectedStatsPerGenerationTable.Rows.Add(new DataRow(rowName) { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Line, LineWidth = 1 } }); 63 rejectedStatsPerGenerationTable.Rows[rowName].Values.Add(0d); 64 nonRejectedStatsPerGenerationTable.Rows.Add(new DataRow(rowName) { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Line, LineWidth = 1 } }); 65 nonRejectedStatsPerGenerationTable.Rows[rowName].Values.Add(0d); 66 } 67 predictionResults.Add(new Result("Rejected Stats Per Generation", rejectedStatsPerGenerationTable)); 68 predictionResults.Add(new Result("Non Rejected Stats Per Generation", nonRejectedStatsPerGenerationTable)); 60 69 ResultCollection.Add(new Result("OS Prediction", predictionResults)); 61 70 } else { … … 63 72 rejectedStatsTable = (DataTable)predictionResults["Rejected Stats"].Value; 64 73 totalStatsTable = (DataTable)predictionResults["Total Stats"].Value; 74 rejectedStatsPerGenerationTable = (DataTable)predictionResults["Rejected Stats Per Generation"].Value; 75 nonRejectedStatsPerGenerationTable = (DataTable)predictionResults["Non Rejected Stats Per Generation"].Value; 65 76 } 66 77 67 78 int i = 0; 68 79 foreach (var rowName in rejectedStats.RowNames) { 69 // add a padding zero below to prevent columns from being cut off to the left80 // pad values with a 0 on each side to prevent clipping 70 81 rejectedStatsTable.Rows[rowName].Values.Replace(new[] { 0d }.Concat(Enumerable.Range(0, rejectedStats.Columns).Select(j => (double)rejectedStats[i, j])).Concat(new[] { 0d })); 71 82 ++i; … … 74 85 foreach (var rowName in totalStats.RowNames) { 75 86 totalStatsTable.Rows[rowName].Values.Replace(new[] { 0d }.Concat(Enumerable.Range(0, totalStats.Columns).Select(j => (double)totalStats[i, j])).Concat(new[] { 0d })); 87 var row = rejectedStatsPerGenerationTable.Rows[rowName]; 88 var sum = row.Values.Sum(); 89 row.Values.Add(totalStats[i, 0] - sum); 90 row = nonRejectedStatsPerGenerationTable.Rows[rowName]; 91 sum = row.Values.Sum(); 92 row.Values.Add(totalStats[i, 1] - sum); 76 93 ++i; 77 94 }
Note: See TracChangeset
for help on using the changeset viewer.