Changeset 4825 for trunk/sources/HeuristicLab.Optimization
- Timestamp:
- 11/17/10 07:41:28 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/sources/HeuristicLab.Optimization/3.3/Run.cs ¶
r4722 r4825 23 23 using System.Collections.Generic; 24 24 using System.Drawing; 25 using System.Linq; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 87 88 88 89 private void Initialize(IAlgorithm algorithm) { 89 IAlgorithm clone = (IAlgorithm)algorithm.Clone();90 90 parameters = new Dictionary<string, IItem>(); 91 91 results = new Dictionary<string, IItem>(); 92 clone.CollectParameterValues(parameters); 93 clone.CollectResultValues(results); 94 if (clone.StoreAlgorithmInEachRun) { 92 93 if (algorithm.StoreAlgorithmInEachRun) { 94 IAlgorithm clone = (IAlgorithm)algorithm.Clone(); 95 clone.CollectParameterValues(parameters); 96 clone.CollectResultValues(results); 95 97 clone.Prepare(true); 96 98 this.algorithm = clone; 99 } else { 100 algorithm.CollectParameterValues(parameters); 101 algorithm.CollectResultValues(results); 102 Cloner cloner = new Cloner(); 103 parameters = parameters.Select(x => new KeyValuePair<string, IItem>(x.Key, (IItem)x.Value.Clone(cloner))).ToDictionary(x => x.Key, x => x.Value); 104 results = results.Select(x => new KeyValuePair<string, IItem>(x.Key, (IItem)x.Value.Clone(cloner))).ToDictionary(x => x.Key, x => x.Value); 97 105 } 98 106 }
Note: See TracChangeset
for help on using the changeset viewer.