- Timestamp:
- 06/25/15 10:30:06 (9 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization/3.3/MetaOptimizers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/MetaOptimizers/BatchRun.cs
r12012 r12504 36 36 /// </summary> 37 37 [Item("Batch Run", "A run in which an optimizer is executed a given number of times.")] 38 [Creatable( "Testing & Analysis")]38 [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 110)] 39 39 [StorableClass] 40 40 public sealed class BatchRun : NamedItem, IOptimizer, IStorableContent { … … 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); } catch (InvalidOperationException) { } 239 try { Optimizer.Prepare(clearRuns); } 240 catch (InvalidOperationException) { } 240 241 } else { 241 242 ExecutionState = ExecutionState.Stopped; … … 249 250 if (Optimizer.ExecutionState == ExecutionState.Stopped) Optimizer.Prepare(); 250 251 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 251 try { Optimizer.Start(); } catch (InvalidOperationException) { } 252 try { Optimizer.Start(); } 253 catch (InvalidOperationException) { } 252 254 } 253 255 public void Pause() { … … 258 260 if (Optimizer.ExecutionState != ExecutionState.Started) return; 259 261 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 260 try { Optimizer.Pause(); } catch (InvalidOperationException) { } 262 try { Optimizer.Pause(); } 263 catch (InvalidOperationException) { } 261 264 } 262 265 public void Stop() { … … 270 273 } 271 274 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 272 try { Optimizer.Stop(); } catch (InvalidOperationException) { } 275 try { Optimizer.Stop(); } 276 catch (InvalidOperationException) { } 273 277 } 274 278 -
trunk/sources/HeuristicLab.Optimization/3.3/MetaOptimizers/Experiment.cs
r12012 r12504 34 34 /// </summary> 35 35 [Item("Experiment", "An experiment which contains multiple algorithms, batch runs or other experiments.")] 36 [Creatable( "Testing & Analysis")]36 [Creatable(CreatableAttribute.Categories.TestingAndAnalysis, Priority = 100)] 37 37 [StorableClass] 38 38 public sealed class Experiment : NamedItem, IOptimizer, IStorableContent { … … 180 180 foreach (IOptimizer optimizer in Optimizers.Where(x => x.ExecutionState != ExecutionState.Started)) { 181 181 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 182 try { optimizer.Prepare(clearRuns); } catch (InvalidOperationException) { } 182 try { optimizer.Prepare(clearRuns); } 183 catch (InvalidOperationException) { } 183 184 } 184 185 } … … 193 194 if (optimizer != null) { 194 195 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 195 try { optimizer.Start(); } catch (InvalidOperationException) { } 196 try { optimizer.Start(); } 197 catch (InvalidOperationException) { } 196 198 } 197 199 } … … 205 207 foreach (IOptimizer optimizer in Optimizers.Where(x => x.ExecutionState == ExecutionState.Started)) { 206 208 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 207 try { optimizer.Pause(); } catch (InvalidOperationException) { } 209 try { optimizer.Pause(); } 210 catch (InvalidOperationException) { } 208 211 } 209 212 } … … 218 221 foreach (var optimizer in Optimizers.Where(x => (x.ExecutionState == ExecutionState.Started) || (x.ExecutionState == ExecutionState.Paused))) { 219 222 // a race-condition may occur when the optimizer has changed the state by itself in the meantime 220 try { optimizer.Stop(); } catch (InvalidOperationException) { } 223 try { optimizer.Stop(); } 224 catch (InvalidOperationException) { } 221 225 } 222 226 } else {
Note: See TracChangeset
for help on using the changeset viewer.