Changeset 3276
- Timestamp:
- 04/06/10 04:12:26 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimization/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimization/3.3/BatchRun.cs
r3275 r3276 259 259 } 260 260 private void Algorithm_Prepared(object sender, EventArgs e) { 261 OnPrepared(); 261 if ((ExecutionState == ExecutionState.Paused) || (ExecutionState == ExecutionState.Stopped)) 262 OnPrepared(); 262 263 } 263 264 private void Algorithm_Started(object sender, EventArgs e) { 264 265 stopPending = false; 265 OnStarted(); 266 if (ExecutionState != ExecutionState.Started) 267 OnStarted(); 266 268 } 267 269 private void Algorithm_Stopped(object sender, EventArgs e) { 268 270 ExecutionTime += Algorithm.ExecutionTime; 269 OnStopped();270 271 271 272 if (!stopPending && (runs.Count < repetitions)) { 272 273 Algorithm.Prepare(); 273 274 Algorithm.Start(); 275 } else { 276 OnStopped(); 274 277 } 275 278 } -
trunk/sources/HeuristicLab.Optimization/3.3/Experiment.cs
r3275 r3276 278 278 } 279 279 private void optimizer_Stopped(object sender, EventArgs e) { 280 bool stop = stopPending; 281 282 if (Optimizers.All(x => (x.ExecutionState != ExecutionState.Started) && (x.ExecutionState != ExecutionState.Paused))) { 283 stopPending = false; 284 OnStopped(); 285 } 286 287 if (!stop) { 288 IOptimizer next = Optimizers.FirstOrDefault(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)); 289 if (next != null) 290 next.Start(); 280 if (!stopPending && Optimizers.Any(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused))) { 281 Optimizers.First(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)).Start(); 282 } else { 283 if (Optimizers.All(x => (x.ExecutionState != ExecutionState.Started) && (x.ExecutionState != ExecutionState.Paused))) { 284 stopPending = false; 285 OnStopped(); 286 } 291 287 } 292 288 }
Note: See TracChangeset
for help on using the changeset viewer.