Changeset 14927 for branches/PersistenceReintegration/HeuristicLab.Optimization/3.3/MetaOptimizers/BatchRun.cs
- Timestamp:
- 05/04/17 17:19:35 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Optimization/3.3/MetaOptimizers/BatchRun.cs
r14185 r14927 27 27 using HeuristicLab.Core; 28 28 using HeuristicLab.Data; 29 using HeuristicLab.Persistence .Default.CompositeSerializers.Storable;29 using HeuristicLab.Persistence; 30 30 31 31 namespace HeuristicLab.Optimization { … … 37 37 [Item("Batch Run", "A run in which an optimizer is executed a given number of times.")] 38 38 [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 110)] 39 [Storable Class]39 [StorableType("99c15ae1-95a6-490e-813f-7a43c09e7c74")] 40 40 public sealed class BatchRun : NamedItem, IOptimizer, IStorableContent { 41 41 public string Filename { get; set; } … … 237 237 batchRunAction = BatchRunAction.Prepare; 238 238 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 239 try { Optimizer.Prepare(clearRuns); } 240 catch (InvalidOperationException) { } 239 try { Optimizer.Prepare(clearRuns); } catch (InvalidOperationException) { } 241 240 } else { 242 241 ExecutionState = ExecutionState.Stopped; … … 250 249 if (Optimizer.ExecutionState == ExecutionState.Stopped) Optimizer.Prepare(); 251 250 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 252 try { Optimizer.Start(); } 253 catch (InvalidOperationException) { } 251 try { Optimizer.Start(); } catch (InvalidOperationException) { } 254 252 } 255 253 public void Pause() { … … 260 258 if (Optimizer.ExecutionState != ExecutionState.Started) return; 261 259 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 262 try { Optimizer.Pause(); } 263 catch (InvalidOperationException) { } 260 try { Optimizer.Pause(); } catch (InvalidOperationException) { } 264 261 } 265 262 public void Stop() { … … 273 270 } 274 271 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 275 try { Optimizer.Stop(); } 276 catch (InvalidOperationException) { } 272 try { Optimizer.Stop(); } catch (InvalidOperationException) { } 277 273 } 278 274
Note: See TracChangeset
for help on using the changeset viewer.