- Timestamp:
- 04/29/15 15:19:58 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectivePruningAnalyzer.cs
r12358 r12361 45 45 private const string TotalNumberOfPrunedSubtreesParameterName = "Number of pruned subtrees"; 46 46 private const string TotalNumberOfPrunedTreesParameterName = "Number of pruned trees"; 47 private const string TotalNumberOfPrunedNodesParameterName = "Number of pruned nodes"; 47 48 private const string RandomParameterName = "Random"; 48 private const string PruneOnlyZeroImpactNodesParameterName = "PruneOnlyZeroImpactNodes";49 private const string NodeImpactThresholdParameterName = "ImpactThreshold";50 private const string PruningOperatorParameterName = "PruningOperator";51 49 private const string ResultsParameterName = "Results"; 52 50 private const string PopulationSizeParameterName = "PopulationSize"; … … 54 52 55 53 #region private members 54 private DataReducer prunedNodesReducer; 56 55 private DataReducer prunedSubtreesReducer; 57 56 private DataReducer prunedTreesReducer; … … 122 121 protected SymbolicDataAnalysisSingleObjectivePruningAnalyzer(SymbolicDataAnalysisSingleObjectivePruningAnalyzer original, Cloner cloner) 123 122 : base(original, cloner) { 123 if (original.prunedNodesReducer != null) 124 this.prunedNodesReducer = (DataReducer)original.prunedNodesReducer.Clone(); 124 125 if (original.prunedSubtreesReducer != null) 125 126 this.prunedSubtreesReducer = (DataReducer)original.prunedSubtreesReducer.Clone(); … … 230 231 UpdateCounter = 0; 231 232 232 if (pruned SubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); }233 if (prunedNodesReducer == null || prunedSubtreesReducer == null || prunedTreesReducer == null || valuesCollector == null || resultsCollector == null) { InitializeOperators(); } 233 234 234 235 var prune = CreatePruningOperation(); 236 var reducePrunedNodes = ExecutionContext.CreateChildOperation(prunedNodesReducer); 235 237 var reducePrunedSubtrees = ExecutionContext.CreateChildOperation(prunedSubtreesReducer); 236 238 var reducePrunedTrees = ExecutionContext.CreateChildOperation(prunedTreesReducer); … … 238 240 var collectResults = ExecutionContext.CreateChildOperation(resultsCollector); 239 241 240 return new OperationCollection { prune, reducePruned Subtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() };242 return new OperationCollection { prune, reducePrunedNodes, reducePrunedSubtrees, reducePrunedTrees, collectValues, collectResults, base.Apply() }; 241 243 } 242 244 243 245 private void InitializeOperators() { 246 prunedNodesReducer = new DataReducer(); 247 prunedNodesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedNodesParameter.ActualName; 248 prunedNodesReducer.ReductionOperation.Value = new ReductionOperation(ReductionOperations.Sum); // sum all the pruned subtrees parameter values 249 prunedNodesReducer.TargetOperation.Value = new ReductionOperation(ReductionOperations.Assign); // asign the sum to the target parameter 250 prunedNodesReducer.TargetParameter.ActualName = TotalNumberOfPrunedNodesParameterName; 251 244 252 prunedSubtreesReducer = new DataReducer(); 245 253 prunedSubtreesReducer.ParameterToReduce.ActualName = PruningOperator.PrunedSubtreesParameter.ActualName; … … 255 263 256 264 valuesCollector = new DataTableValuesCollector(); 265 valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedNodesParameterName)); 257 266 valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedSubtreesParameterName)); 258 267 valuesCollector.CollectedValues.Add(new LookupParameter<IntValue>(TotalNumberOfPrunedTreesParameterName));
Note: See TracChangeset
for help on using the changeset viewer.