Changeset 10115 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching
- Timestamp:
- 11/08/13 10:10:07 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.SolutionCaching/3.3/RunCollectionModifiers/RunCollectionModifierExecutable.cs
r10114 r10115 62 62 get { return (ValueParameter<ItemList<IRunCollectionModifier>>)Parameters["RunCollectionModifiers"]; } 63 63 } 64 public RunCollection RunCollection { 65 get { return RunCollectionParameter.Value; } 66 protected set { RunCollectionParameter.Value = value; } 67 } 68 public ValueParameter<RunCollection> RunCollectionParameter { 69 get { return (ValueParameter<RunCollection>)Parameters["RunCollection"]; } 70 } 64 71 public ItemList<IRunCollectionModifier> RunCollectionModifiers { 65 72 get { return RunCollectionModifiersParameter.Value; } 66 }67 68 [Storable]69 protected RunCollection runCollection;70 public RunCollection RunCollection {71 get { return runCollection; }72 73 } 73 74 … … 90 91 public RunCollectionModifierExecutable() { 91 92 Parameters.Add(new ValueParameter<ItemList<IRunCollectionModifier>>("RunCollectionModifiers", "List of RunCollectionModifiers that are executed. ", new ItemList<IRunCollectionModifier>())); 93 Parameters.Add(new ValueParameter<RunCollection>("RunCollection", "RunCollection on which the modifiers are applied. ", new RunCollection())); 92 94 executionStack = new Stack<IRunCollectionModifier>(); 93 runCollection = new RunCollection();94 95 log = new Log(); 95 96 } … … 100 101 executionTime = original.executionTime; 101 102 executionState = original.executionState; 102 runCollection = (RunCollection)original.runCollection.Clone(cloner);103 103 executionStack = new Stack<IRunCollectionModifier>(); 104 104 foreach (var runCollectionModifier in original.executionStack) { … … 165 165 CancellationToken ct = (CancellationToken)state; 166 166 OnStarted(); 167 var runs = RunCollection.ToList(); 167 168 168 169 IRunCollectionModifier next; … … 171 172 try { 172 173 ct.ThrowIfCancellationRequested(); 173 next.Modify(run Collection.ToList());174 next.Modify(runs); 174 175 } 175 176 catch (Exception ex) { … … 177 178 if (ex is OperationCanceledException) throw ex; 178 179 else throw new Exception("IRunCollectionModifier " + next + "threw an exception.", ex); 180 } 181 finally { 182 RunCollection = new RunCollection(runs); 179 183 } 180 184 }
Note: See TracChangeset
for help on using the changeset viewer.