Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11762 for trunk


Ignore:
Timestamp:
01/15/15 11:30:03 (10 years ago)
Author:
mkommend
Message:

#2278: Merged changes in HL.Optimization into the trunk.

Location:
trunk/sources/HeuristicLab.Optimization
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/Classification-Extensions/HeuristicLab.Optimizationmergedeligible
      /branches/HLScript/HeuristicLab.Optimizationmergedeligible
      /stable/HeuristicLab.Optimizationmergedeligible
      /branches/1721-RandomForestPersistence/HeuristicLab.Optimization10321-10322
      /branches/Algorithms.GradientDescent/HeuristicLab.Optimization5516-5520
      /branches/Benchmarking/sources/HeuristicLab.Optimization6917-7005
      /branches/CloningRefactoring/HeuristicLab.Optimization4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.Optimization5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.Optimization5815-6180
      /branches/DataAnalysis/HeuristicLab.Optimization4458-4459,​4462,​4464
      /branches/DataPreprocessing/HeuristicLab.Optimization10085-11101
      /branches/GP.Grammar.Editor/HeuristicLab.Optimization6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Optimization5060
      /branches/HeuristicLab.Problems.DataAnalysis.Trading/HeuristicLab.Optimization6123-9799
      /branches/LogResidualEvaluator/HeuristicLab.Optimization10202-10483
      /branches/NET40/sources/HeuristicLab.Optimization5138-5162
      /branches/ParallelEngine/HeuristicLab.Optimization5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Optimization7568-7810
      /branches/QAPAlgorithms/HeuristicLab.Optimization6350-6627
      /branches/Restructure trunk solution/HeuristicLab.Optimization6828
      /branches/RuntimeOptimizer/HeuristicLab.Optimization8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.Optimization7787-8333
      /branches/SlaveShutdown/HeuristicLab.Optimization8944-8956
      /branches/SpectralKernelForGaussianProcesses/HeuristicLab.Optimization10204-10479
      /branches/SuccessProgressAnalysis/HeuristicLab.Optimization5370-5682
      /branches/Trunk/HeuristicLab.Optimization6829-6865
      /branches/UnloadJobs/HeuristicLab.Optimization9168-9215
      /branches/VNS/HeuristicLab.Optimization5594-5752
      /branches/histogram/HeuristicLab.Optimization5959-6341
  • trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs

    r11171 r11762  
    227227    public virtual void CollectResultValues(IDictionary<string, IItem> values) {
    228228      values.Add("Execution Time", new TimeSpanValue(ExecutionTime));
    229       CollectResultsRecursively("", Results, values);
    230     }
    231 
    232     private void CollectResultsRecursively(string path, ResultCollection results, IDictionary<string, IItem> values) {
    233       foreach (IResult result in results) {
    234         values.Add(path + result.Name, result.Value);
    235         ResultCollection childCollection = result.Value as ResultCollection;
    236         if (childCollection != null) {
    237           CollectResultsRecursively(path + result.Name + ".", childCollection, values);
    238         }
    239       }
     229      Results.CollectResultValues(values);
    240230    }
    241231
  • trunk/sources/HeuristicLab.Optimization/3.3/ResultCollection.cs

    r11171 r11762  
    4444      get { return HeuristicLab.Common.Resources.VSImageLibrary.Object; }
    4545    }
     46
     47    public virtual void CollectResultValues(IDictionary<string, IItem> values) {
     48      CollectResultValues(values, string.Empty);
     49    }
     50
     51    public virtual void CollectResultValues(IDictionary<string, IItem> values, string rootPath) {
     52      foreach (IResult result in this) {
     53        var children = GetCollectedResults(result);
     54        string path = string.Empty;
     55        if (!string.IsNullOrWhiteSpace(rootPath))
     56          path = rootPath + ".";
     57        foreach (var c in children) {
     58          if (string.IsNullOrEmpty(c.Key))
     59            values.Add(path + result.Name, c.Value);
     60          else values.Add(path + result.Name + "." + c.Key, c.Value);
     61        }
     62      }
     63    }
     64
     65    protected virtual IEnumerable<KeyValuePair<string, IItem>> GetCollectedResults(IResult result) {
     66      if (result.Value == null) yield break;
     67      yield return new KeyValuePair<string, IItem>(string.Empty, result.Value);
     68
     69      var resultCollection = result.Value as ResultCollection;
     70      if (resultCollection != null) {
     71        var children = new Dictionary<string, IItem>();
     72        resultCollection.CollectResultValues(children);
     73        foreach (var child in children) yield return child;
     74      }
     75    }
     76
    4677  }
    4778}
Note: See TracChangeset for help on using the changeset viewer.