Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8865


Ignore:
Timestamp:
10/31/12 10:11:56 (10 years ago)
Author:
ascheibe
Message:

#1886 fixed crossover performance operator initialization

Location:
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/CrossoverPerformanceAnalyzer.cs

    r8864 r8865  
    180180      }
    181181      successHelper.InitializeChart(Results, "Successfull Crossovers", successfullCXRowNames.ToArray());
     182      Reset();
    182183    }
    183184
     
    252253        parentDiversityHelper.AddPoint(curGenStr, diversityPointParent);
    253254        parentQualityHelper.AddPoint(curGenStr, qualityPointParent);
    254       } else {
    255         Reset();
    256       }
     255      }
    257256
    258257      return base.Apply();
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/InitializableOperator.cs

    r8797 r8865  
    5959    protected void Initialize() {
    6060      if (Initialized.ActualValue == null) {
    61         Initialized.ActualValue = new BoolValue(true);
     61        AddVariableToGlobalScope(guid.ToString(), "Indicates if the operator is initialized.", new BoolValue(true));
    6262        InitializeAction();
    6363      } else if (!Initialized.ActualValue.Value) {
     
    6767    }
    6868
     69    private void AddVariableToGlobalScope(string name, string description, BoolValue value) {
     70      var globalScope = ExecutionContext;
     71      while (globalScope.Parent != null) {
     72        globalScope = globalScope.Parent;
     73      }
     74
     75      globalScope.Scope.Variables.Add(new Variable(name, description, value));
     76    }
     77
    6978    protected virtual void InitializeAction() { }
    7079  }
Note: See TracChangeset for help on using the changeset viewer.