Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/12 17:39:55 (12 years ago)
Author:
gkronber
Message:

#1875 set the ExecutionState to stopped only after all results have been generated. This mitigates the problem of the race condition in CrossValidation even though the underlying problem is not actually solved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization/3.3/Algorithms/Algorithm.cs

    r7706 r8155  
    272272    public event EventHandler Prepared;
    273273    protected virtual void OnPrepared() {
    274       ExecutionState = ExecutionState.Prepared;
    275274      ExecutionTime = TimeSpan.Zero;
    276275      foreach (IStatefulItem statefulObject in this.GetObjectGraphObjects(new HashSet<string>() { "runs" }).OfType<IStatefulItem>()) {
    277276        statefulObject.InitializeState();
    278277      }
     278      ExecutionState = ExecutionState.Prepared;
    279279      EventHandler handler = Prepared;
    280280      if (handler != null) handler(this, EventArgs.Empty);
     
    294294    public event EventHandler Stopped;
    295295    protected virtual void OnStopped() {
    296       ExecutionState = ExecutionState.Stopped;
    297296      foreach (IStatefulItem statefulObject in this.GetObjectGraphObjects(new HashSet<string>() { "runs" }).OfType<IStatefulItem>()) {
    298297        statefulObject.ClearState();
     
    300299      runsCounter++;
    301300      runs.Add(new Run(string.Format("{0} Run {1}", Name, runsCounter), this));
     301      ExecutionState = ExecutionState.Stopped;
    302302      EventHandler handler = Stopped;
    303303      if (handler != null) handler(this, EventArgs.Empty);
Note: See TracChangeset for help on using the changeset viewer.