Changeset 11594 for branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs
- Timestamp:
- 11/27/14 11:23:37 (10 years ago)
- Location:
- branches/Breadcrumbs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Breadcrumbs
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/Breadcrumbs/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs
r9456 r11594 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 3Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 81 81 Parameters.Add(new LookupParameter<ResultCollection>("SuccessfulOffspringAnalysis", "The successful offspring analysis which is created.")); 82 82 Parameters.Add(new ValueParameter<IntValue>("Depth", "The depth of the individuals in the scope tree.", new IntValue(1))); 83 84 CollectedValuesParameter.Value.Add(new StringValue("SelectedCrossoverOperator")); 85 CollectedValuesParameter.Value.Add(new StringValue("SelectedManipulationOperator")); 83 86 } 84 87 … … 110 113 } 111 114 112 //create a data table containing the collected values 113 ResultCollection successfulOffspringAnalysis; 115 if (counts.Count > 0) { 116 //create a data table containing the collected values 117 ResultCollection successfulOffspringAnalysis; 114 118 115 if (SuccessfulOffspringAnalysisParameter.ActualValue == null) { 116 successfulOffspringAnalysis = new ResultCollection(); 117 SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis; 118 } else { 119 successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue; 120 } 121 122 string resultKey = "SuccessfulOffspringAnalyzer Results"; 123 if (!results.ContainsKey(resultKey)) { 124 results.Add(new Result(resultKey, successfulOffspringAnalysis)); 125 } else { 126 results[resultKey].Value = successfulOffspringAnalysis; 127 } 128 129 DataTable successProgressAnalysis; 130 if (!successfulOffspringAnalysis.ContainsKey(collected.Value)) { 131 successProgressAnalysis = new DataTable(); 132 successProgressAnalysis.Name = collected.Value; 133 successfulOffspringAnalysis.Add(new Result(collected.Value, successProgressAnalysis)); 134 } else { 135 successProgressAnalysis = successfulOffspringAnalysis[collected.Value].Value as DataTable; 136 } 137 138 int successfulCount = 0; 139 foreach (string key in counts.Keys) { 140 successfulCount += counts[key]; 141 } 142 143 foreach (String value in counts.Keys) { 144 DataRow row; 145 if (!successProgressAnalysis.Rows.ContainsKey(value)) { 146 row = new DataRow(value); 147 int iterations = GenerationsParameter.ActualValue.Value; 148 149 //fill up all values seen the first time 150 for (int i = 1; i < iterations; i++) 151 row.Values.Add(0); 152 153 successProgressAnalysis.Rows.Add(row); 119 if (SuccessfulOffspringAnalysisParameter.ActualValue == null) { 120 successfulOffspringAnalysis = new ResultCollection(); 121 SuccessfulOffspringAnalysisParameter.ActualValue = successfulOffspringAnalysis; 154 122 } else { 155 row = successProgressAnalysis.Rows[value];123 successfulOffspringAnalysis = SuccessfulOffspringAnalysisParameter.ActualValue; 156 124 } 157 125 158 row.Values.Add(counts[value] / (double)successfulCount); 159 } 126 string resultKey = "SuccessfulOffspringAnalyzer Results"; 127 if (!results.ContainsKey(resultKey)) { 128 results.Add(new Result(resultKey, successfulOffspringAnalysis)); 129 } else { 130 results[resultKey].Value = successfulOffspringAnalysis; 131 } 160 132 161 //fill up all values that are not present in the current generation 162 foreach (DataRow row in successProgressAnalysis.Rows) { 163 if (!counts.ContainsKey(row.Name)) 164 row.Values.Add(0); 133 DataTable successProgressAnalysis; 134 if (!successfulOffspringAnalysis.ContainsKey(collected.Value)) { 135 successProgressAnalysis = new DataTable(); 136 successProgressAnalysis.Name = collected.Value; 137 successfulOffspringAnalysis.Add(new Result(collected.Value, successProgressAnalysis)); 138 } else { 139 successProgressAnalysis = successfulOffspringAnalysis[collected.Value].Value as DataTable; 140 } 141 142 int successfulCount = 0; 143 foreach (string key in counts.Keys) { 144 successfulCount += counts[key]; 145 } 146 147 foreach (String value in counts.Keys) { 148 DataRow row; 149 if (!successProgressAnalysis.Rows.ContainsKey(value)) { 150 row = new DataRow(value); 151 int iterations = GenerationsParameter.ActualValue.Value; 152 153 //fill up all values seen the first time 154 for (int i = 1; i < iterations; i++) 155 row.Values.Add(0); 156 157 successProgressAnalysis.Rows.Add(row); 158 } else { 159 row = successProgressAnalysis.Rows[value]; 160 } 161 162 row.Values.Add(counts[value] / (double)successfulCount); 163 } 164 165 //fill up all values that are not present in the current generation 166 foreach (DataRow row in successProgressAnalysis.Rows) { 167 if (!counts.ContainsKey(row.Name)) 168 row.Values.Add(0); 169 } 165 170 } 166 171 }
Note: See TracChangeset
for help on using the changeset viewer.