Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/17 12:31:54 (7 years ago)
Author:
jkarder
Message:

#1853: worked on ParameterConfigurationEncoding

  • updated to .NET 4.5
  • replaced CreateExperimentDialogV2 with CreateExperimentView
  • improved experiment generation
  • fixed plugin dependencies and cleaned project references
Location:
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3

    • Property svn:ignore set to
      Plugin.cs
  • branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ExperimentFactory.cs

    r8574 r15171  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Linq;
    2425using System.Threading;
    2526using HeuristicLab.Optimization;
     
    3233      get { return experimentGenerationProgress; }
    3334      private set {
    34         if (experimentGenerationProgress != value) {
    35           experimentGenerationProgress = value;
    36           OnExperimentGenerationProgressChanged();
    37         }
     35        experimentGenerationProgress = value;
     36        OnExperimentGenerationProgressChanged();
    3837      }
    3938    }
     
    4746    public Experiment GenerateExperiment(IAlgorithm algorithm, ParameterConfigurationTree configuration, bool createBatchRuns, int repetitions, Dictionary<IProblemInstanceProvider, HashSet<IDataDescriptor>> problemInstances, CancellationToken ct) {
    4847      var experiment = new Experiment();
    49       var algorithms = new List<IAlgorithm>(1 + problemInstances.Values.Count) { (IAlgorithm)algorithm.Clone() };
    50       foreach (var provider in problemInstances) {
    51         foreach (var descriptor in provider.Value) {
    52           var alg = (IAlgorithm)algorithm.Clone();
    53           ProblemInstanceManager.LoadData(provider.Key, descriptor, (IProblemInstanceConsumer)alg.Problem);
    54           algorithms.Add(alg);
     48      var algorithms = new List<IAlgorithm>();
     49
     50      if (problemInstances.Values.Sum(x => x.Count) > 0) {
     51        foreach (var provider in problemInstances) {
     52          foreach (var descriptor in provider.Value) {
     53            var alg = (IAlgorithm)algorithm.Clone();
     54            ProblemInstanceManager.LoadData(provider.Key, descriptor, (IProblemInstanceConsumer)alg.Problem);
     55            algorithms.Add(alg);
     56          }
    5557        }
    56       }
     58      } else algorithms.Add((IAlgorithm)algorithm.Clone());
     59
    5760      ExperimentGenerationProgress = 0;
     61
    5862      foreach (var alg in algorithms) {
    5963        foreach (ParameterizedValueConfiguration combination in configuration) {
     
    7478        }
    7579      }
     80
    7681      return experiment;
    7782    }
Note: See TracChangeset for help on using the changeset viewer.