Changeset 14433 for trunk/sources/HeuristicLab.Optimization/3.3/Algorithms
- Timestamp:
- 12/01/16 14:49:02 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs
r14185 r14433 289 289 public event EventHandler Stopped; 290 290 protected virtual void OnStopped() { 291 foreach (IStatefulItem statefulObject in this.GetObjectGraphObjects(new HashSet<object>() { Runs }).OfType<IStatefulItem>()) { 292 statefulObject.ClearState(); 293 } 294 runsCounter++; 295 runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this)); 296 ExecutionState = ExecutionState.Stopped; 297 EventHandler handler = Stopped; 298 if (handler != null) handler(this, EventArgs.Empty); 291 try { 292 foreach ( 293 IStatefulItem statefulObject in 294 this.GetObjectGraphObjects(new HashSet<object>() {Runs}).OfType<IStatefulItem>()) { 295 statefulObject.ClearState(); 296 } 297 runsCounter++; 298 try { 299 runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this)); 300 } 301 catch (ArgumentException e) { 302 OnExceptionOccurred(new InvalidOperationException("Run creation failed.", e)); 303 } 304 } 305 finally { 306 ExecutionState = ExecutionState.Stopped; 307 EventHandler handler = Stopped; 308 if (handler != null) handler(this, EventArgs.Empty); 309 } 299 310 } 300 311 public event EventHandler<EventArgs<Exception>> ExceptionOccurred;
Note: See TracChangeset
for help on using the changeset viewer.