Changeset 15284


Ignore:
Timestamp:
07/25/17 14:16:08 (15 months ago)
Author:
jkarder
Message:

#2258: worked on basic algorithm and cross-validation

Location:
branches/Async
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Async/HeuristicLab.Algorithms.DataAnalysis/3.4/CrossValidation.cs

    r15281 r15284  
    381381        pausePending = true;
    382382        lock (locker) {
    383           var toPause = clonedAlgorithms.Where(x => x.ExecutionState == ExecutionState.Started);
     383          var toPause = clonedAlgorithms.Where(x => x.ExecutionState == ExecutionState.Started).ToList();
    384384          foreach (var optimizer in toPause) {
    385385            // a race-condition may occur when the optimizer has changed the state by itself in the meantime
     
    399399        stopPending = true;
    400400        lock (locker) {
    401           var toStop = clonedAlgorithms.Where(x => x.ExecutionState == ExecutionState.Started || x.ExecutionState == ExecutionState.Paused);
     401          var toStop = clonedAlgorithms.Where(x => x.ExecutionState == ExecutionState.Started || x.ExecutionState == ExecutionState.Paused).ToList();
    402402          foreach (var optimizer in toStop) {
    403403            // a race-condition may occur when the optimizer has changed the state by itself in the meantime
  • branches/Async/HeuristicLab.Optimization/3.3/Algorithms/BasicAlgorithm.cs

    r15281 r15284  
    7676      pausePending = false;
    7777      OnStarted();
     78
    7879      try {
    7980        Run((object)cancellationTokenSource.Token);
     
    8788      CancellationTokenSource.Dispose();
    8889      CancellationTokenSource = null;
    89       OnStopped();
     90      if (pausePending) OnPaused();
     91      else OnStopped();
    9092    }
    9193
Note: See TracChangeset for help on using the changeset viewer.