Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5195


Ignore:
Timestamp:
01/03/11 05:43:27 (14 years ago)
Author:
swagner
Message:

Cleared global scope after an EngineAlgorithm is stopped (#1355)

Location:
trunk/sources/HeuristicLab.Optimization/3.3
Files:
2 edited

Legend:

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

    r4722 r5195  
    117117    private void AfterDeserialization() {
    118118      Initialize();
     119
     120      // BackwardsCompatibility3.3
     121      #region Backwards compatible code (remove with 3.4)
     122      // clear global scope if it contains any sub-scopes or additional variables
     123      if ((ExecutionState == Core.ExecutionState.Stopped) && ((globalScope.SubScopes.Count > 0) || (globalScope.Variables.Count > 1))) {
     124        ResultCollection results = Results;
     125        globalScope.Clear();
     126        globalScope.Variables.Add(new Variable("Results", results));
     127      }
     128      #endregion
    119129    }
    120130
     
    212222    }
    213223    private void Engine_Stopped(object sender, EventArgs e) {
     224      ResultCollection results = Results;
     225      globalScope.Clear();
     226      globalScope.Variables.Add(new Variable("Results", results));
    214227      OnStopped();
    215228    }
  • trunk/sources/HeuristicLab.Optimization/3.3/Run.cs

    r4833 r5195  
    9595        clone.CollectParameterValues(parameters);
    9696        clone.CollectResultValues(results);
    97         clone.Prepare(true);
     97        clone.Runs.Clear();
    9898        this.algorithm = clone;
    9999      } else {
Note: See TracChangeset for help on using the changeset viewer.