- Timestamp:
- 01/03/12 11:22:21 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
- Property svn:mergeinfo changed
/trunk/sources merged: 7214,7216-7230,7233-7239,7241,7243-7252,7254,7256-7261,7265-7266
- Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Optimization/3.3/Experiment.cs
r7213 r7268 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 1Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 175 175 176 176 if (clearRuns) runs.Clear(); 177 178 experimentStarted = false; 179 experimentStopped = false; 177 180 foreach (IOptimizer optimizer in Optimizers.Where(x => x.ExecutionState != ExecutionState.Started)) 178 181 if (clearRuns || optimizer.ExecutionState != ExecutionState.Prepared) … … 206 209 experimentStarted = false; 207 210 experimentStopped = true; 208 foreach (IOptimizer optimizer in Optimizers.Where(x => (x.ExecutionState == ExecutionState.Started) || (x.ExecutionState == ExecutionState.Paused))) 209 optimizer.Stop(); 211 if (Optimizers.Any(x => (x.ExecutionState == ExecutionState.Started) || (x.ExecutionState == ExecutionState.Paused))) { 212 foreach (IOptimizer optimizer in Optimizers.Where(x => (x.ExecutionState == ExecutionState.Started) || (x.ExecutionState == ExecutionState.Paused))) 213 optimizer.Stop(); 214 } else { 215 OnStopped(); 216 } 210 217 } 211 218 … … 326 333 } 327 334 private void optimizer_Paused(object sender, EventArgs e) { 328 if (Optimizers.All(x => x.ExecutionState != ExecutionState.Started)) 329 OnPaused(); 335 if (Optimizers.All(x => x.ExecutionState != ExecutionState.Started)) OnPaused(); 330 336 } 331 337 private void optimizer_Prepared(object sender, EventArgs e) { 332 if ( ExecutionState == ExecutionState.Stopped)333 OnPrepared();338 if (Optimizers.All(x => x.ExecutionState == ExecutionState.Prepared)) OnPrepared(); 339 else if (Optimizers.All(x => x.ExecutionState != ExecutionState.Started)) OnPaused(); 334 340 } 335 341 private void optimizer_Started(object sender, EventArgs e) { 336 if (ExecutionState != ExecutionState.Started) 337 OnStarted(); 342 if (ExecutionState != ExecutionState.Started) OnStarted(); 338 343 } 339 344 private void optimizer_Stopped(object sender, EventArgs e) { 340 if (experimentStopped && Optimizers.All(o => o.ExecutionState == ExecutionState.Stopped || o.ExecutionState == ExecutionState.Prepared)) OnStopped(); 341 else if (Optimizers.Any(o => o.ExecutionState == ExecutionState.Stopped) && Optimizers.All(o => o.ExecutionState != ExecutionState.Started) && Optimizers.All(o => o.ExecutionState != ExecutionState.Paused)) OnStopped(); 342 else if (Optimizers.Any(o => o.ExecutionState == ExecutionState.Paused) && Optimizers.All(o => o.ExecutionState != ExecutionState.Started)) OnPaused(); 343 else if (experimentStarted && !experimentStopped && Optimizers.Any(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused))) { 344 Optimizers.First(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)).Start(); 345 if (experimentStopped) { 346 if (Optimizers.All(x => (x.ExecutionState == ExecutionState.Stopped) || (x.ExecutionState == ExecutionState.Prepared))) OnStopped(); 347 } else { 348 if (experimentStarted && Optimizers.Any(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused))) { 349 Optimizers.First(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)).Start(); 350 } else if (Optimizers.All(x => x.ExecutionState == ExecutionState.Stopped)) OnStopped(); 351 else if (Optimizers.Any(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)) && Optimizers.All(o => o.ExecutionState != ExecutionState.Started)) OnPaused(); 345 352 } 346 353 }
Note: See TracChangeset
for help on using the changeset viewer.