Changeset 10346 for trunk/sources
- Timestamp:
- 01/16/14 14:30:40 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/SuccessfulOffspringAnalysis/SuccessfulOffspringAnalyzer.cs
r9456 r10346 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 } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/MultiBinaryVectorCrossover.cs
r10295 r10346 64 64 Operators.Add((IBinaryVectorCrossover)Activator.CreateInstance(type), true); 65 65 } 66 67 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 66 68 } 67 69 -
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Crossovers/MultiIntegerVectorCrossover.cs
r10295 r10346 70 70 Operators.Add((IIntegerVectorCrossover)Activator.CreateInstance(type), true); 71 71 } 72 73 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 72 74 } 73 75 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Crossovers/MultiPermutationCrossover.cs
r10295 r10346 64 64 Operators.Add((IPermutationCrossover)Activator.CreateInstance(type), true); 65 65 } 66 67 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 66 68 } 67 69 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Manipulators/MultiPermutationManipulator.cs
r10295 r10346 57 57 Operators.Add((IPermutationManipulator)Activator.CreateInstance(type), true); 58 58 } 59 60 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 59 61 } 60 62 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Crossovers/MultiRealVectorCrossover.cs
r10295 r10346 70 70 Operators.Add((IRealVectorCrossover)Activator.CreateInstance(type), true); 71 71 } 72 73 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 72 74 } 73 75 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Manipulators/MultiRealVectorManipulator.cs
r10295 r10346 62 62 Operators.Add(new PolynomialOnePositionManipulator()); 63 63 Operators.Add(new UniformOnePositionManipulator()); 64 65 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 64 66 } 65 67 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs
r9456 r10346 106 106 Operators = checkedItemList.AsReadOnly(); 107 107 Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems)); 108 109 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 108 110 } 109 111 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs
r9456 r10346 83 83 Operators = checkedItemList.AsReadOnly(); 84 84 Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems)); 85 86 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 85 87 } 86 88 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs
r9456 r10346 109 109 InitializeOperators(); 110 110 name = "MultiSymbolicDataAnalysisExpressionCrossover"; 111 112 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 111 113 } 112 114 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r10295 r10346 67 67 Parameters.Add(new LookupParameter<IVRPEncoding>("Child", "The child permutation resulting from the crossover.")); 68 68 ChildParameter.ActualName = "VRPTours"; 69 70 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 69 71 } 70 72 -
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/MultiVRPSolutionManipulator.cs
r10295 r10346 59 59 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 60 60 Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours to be manipulated.")); 61 62 SelectedOperatorParameter.ActualName = "SelectedManipulationOperator"; 61 63 } 62 64
Note: See TracChangeset
for help on using the changeset viewer.