Changeset 15171 for branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ExperimentFactory.cs
- Timestamp:
- 07/08/17 12:31:54 (7 years ago)
- 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
-
Property
svn:ignore
set to
-
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding/3.3/ExperimentFactory.cs
r8574 r15171 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using System.Threading; 25 26 using HeuristicLab.Optimization; … … 32 33 get { return experimentGenerationProgress; } 33 34 private set { 34 if (experimentGenerationProgress != value) { 35 experimentGenerationProgress = value; 36 OnExperimentGenerationProgressChanged(); 37 } 35 experimentGenerationProgress = value; 36 OnExperimentGenerationProgressChanged(); 38 37 } 39 38 } … … 47 46 public Experiment GenerateExperiment(IAlgorithm algorithm, ParameterConfigurationTree configuration, bool createBatchRuns, int repetitions, Dictionary<IProblemInstanceProvider, HashSet<IDataDescriptor>> problemInstances, CancellationToken ct) { 48 47 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 } 55 57 } 56 } 58 } else algorithms.Add((IAlgorithm)algorithm.Clone()); 59 57 60 ExperimentGenerationProgress = 0; 61 58 62 foreach (var alg in algorithms) { 59 63 foreach (ParameterizedValueConfiguration combination in configuration) { … … 74 78 } 75 79 } 80 76 81 return experiment; 77 82 }
Note: See TracChangeset
for help on using the changeset viewer.