Changeset 13354
- Timestamp:
- 11/24/15 12:20:43 (9 years ago)
- Location:
- branches/Async
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Algorithms.Benchmarks/3.3/BenchmarkAlgorithm.cs
r13349 r13354 305 305 } 306 306 public async Task StartAsync() { 307 await StartAsync( new CancellationToken());307 await StartAsync(CancellationToken.None); 308 308 } 309 309 public async Task StartAsync(CancellationToken cancellationToken) { -
branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs
r13349 r13354 41 41 public sealed class CrossValidation : ParameterizedNamedItem, IAlgorithm, IStorableContent { 42 42 private readonly ManualResetEvent signaler = new ManualResetEvent(true); 43 private CancellationToken cancellationToken; 43 44 44 45 public CrossValidation() … … 272 273 } 273 274 public async Task StartAsync() { 274 await StartAsync( new CancellationToken());275 await StartAsync(CancellationToken.None); 275 276 } 276 277 public async Task StartAsync(CancellationToken cancellationToken) { 278 this.cancellationToken = cancellationToken; 277 279 signaler.Reset(); 278 280 await Task.Run(() => { … … 682 684 IAlgorithm preparedAlgorithm = clonedAlgorithms.FirstOrDefault(alg => alg.ExecutionState == ExecutionState.Prepared || 683 685 alg.ExecutionState == ExecutionState.Paused); 684 if (preparedAlgorithm != null) preparedAlgorithm.StartAsync( );686 if (preparedAlgorithm != null) preparedAlgorithm.StartAsync(cancellationToken); 685 687 } 686 688 if (ExecutionState != ExecutionState.Stopped) { -
branches/Async/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBAlgorithm.cs
r13349 r13354 255 255 } 256 256 public async Task StartAsync() { 257 await StartAsync( new CancellationToken());257 await StartAsync(CancellationToken.None); 258 258 } 259 259 public async Task StartAsync(CancellationToken cancellationToken) { -
branches/Async/HeuristicLab.Core/3.3/Executable.cs
r13349 r13354 88 88 } 89 89 public async Task StartAsync() { 90 await StartAsync( new CancellationToken());90 await StartAsync(CancellationToken.None); 91 91 } 92 92 public virtual async Task StartAsync(CancellationToken cancellationToken) { -
branches/Async/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs
r13349 r13354 208 208 } 209 209 public async Task StartAsync() { 210 await StartAsync( new CancellationToken());210 await StartAsync(CancellationToken.None); 211 211 } 212 212 public virtual async Task StartAsync(CancellationToken cancellationToken) { -
branches/Async/HeuristicLab.Optimization/3.3/MetaOptimizers/BatchRun.cs
r13349 r13354 42 42 public sealed class BatchRun : NamedItem, IOptimizer, IStorableContent { 43 43 private readonly ManualResetEvent signaler = new ManualResetEvent(true); 44 private CancellationToken cancellationToken; 44 45 45 46 public string Filename { get; set; } … … 251 252 } 252 253 public async Task StartAsync() { 253 await StartAsync( new CancellationToken());254 await StartAsync(CancellationToken.None); 254 255 } 255 256 public async Task StartAsync(CancellationToken cancellationToken) { 257 this.cancellationToken = cancellationToken; 256 258 signaler.Reset(); 257 259 await Task.Run(async () => { … … 413 415 else if (batchRunAction == BatchRunAction.Start) { 414 416 Optimizer.Prepare(); 415 Optimizer.StartAsync( );417 Optimizer.StartAsync(cancellationToken); 416 418 } else if (executionState == ExecutionState.Started) { 417 419 // if the batch run hasn't been started but the inner optimizer was run then pause -
branches/Async/HeuristicLab.Optimization/3.3/MetaOptimizers/Experiment.cs
r13349 r13354 40 40 public sealed class Experiment : NamedItem, IOptimizer, IStorableContent { 41 41 private readonly ManualResetEvent signaler = new ManualResetEvent(true); 42 private CancellationToken cancellationToken; 42 43 43 44 public string Filename { get; set; } … … 192 193 } 193 194 public async Task StartAsync() { 194 await StartAsync( new CancellationToken());195 await StartAsync(CancellationToken.None); 195 196 } 196 197 public async Task StartAsync(CancellationToken cancellationToken) { 198 this.cancellationToken = cancellationToken; 197 199 signaler.Reset(); 198 200 await Task.Run(async () => { … … 395 397 } else { 396 398 if (experimentStarted && Optimizers.Any(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused))) { 397 Optimizers.First(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)).StartAsync( );399 Optimizers.First(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)).StartAsync(cancellationToken); 398 400 } else if (Optimizers.All(x => x.ExecutionState == ExecutionState.Stopped)) OnStopped(); 399 401 else if (Optimizers.Any(x => (x.ExecutionState == ExecutionState.Prepared) || (x.ExecutionState == ExecutionState.Paused)) && Optimizers.All(o => o.ExecutionState != ExecutionState.Started)) OnPaused(); -
branches/Async/HeuristicLab.Optimization/3.3/MetaOptimizers/TimeLimitRun.cs
r13349 r13354 244 244 } 245 245 public async Task StartAsync() { 246 await StartAsync( new CancellationToken());246 await StartAsync(CancellationToken.None); 247 247 } 248 248 public async Task StartAsync(CancellationToken cancellationToken) {
Note: See TracChangeset
for help on using the changeset viewer.