Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/28/09 19:24:23 (15 years ago)
Author:
gkronber
Message:

Created a branch for #713

Location:
branches/GP-Refactoring-713
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Manipulation/FullTreeShaker.cs

    r706 r2202  
    3333  public class FullTreeShaker : DelegatingOperator {
    3434    public override string Description {
    35       get { return "Manipulates all tree nodes for which a '" + FunctionBase.MANIPULATION + "' variable is defined."; }
     35      get { return "Manipulates all tree nodes for which a manipulator is defined."; }
    3636    }
    3737
     
    3939      : base() {
    4040      AddVariableInfo(new VariableInfo("Random", "A random generator (uniform)", typeof(MersenneTwister), VariableKind.In));
    41       AddVariableInfo(new VariableInfo("OperatorLibrary", "Operator library that defines operator mutations", typeof(GPOperatorLibrary), VariableKind.In));
     41      AddVariableInfo(new VariableInfo("OperatorLibrary", "Operator library that defines operator mutations", typeof(FunctionLibrary), VariableKind.In));
    4242      AddVariableInfo(new VariableInfo("ShakingFactor", "Variable that determines the force of the shaking operation", typeof(DoubleData), VariableKind.In));
    4343      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree that should be mutated", typeof(IFunctionTree), VariableKind.In | VariableKind.Out));
     
    4545
    4646    public override IOperation Apply(IScope scope) {
    47       GPOperatorLibrary library = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
     47      FunctionLibrary library = GetVariableValue<FunctionLibrary>("OperatorLibrary", scope, true);
    4848      IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, false);
    4949      MersenneTwister mt = GetVariableValue<MersenneTwister>("Random", scope, true);
     
    5656
    5757      TreeGardener gardener = new TreeGardener(mt, library);
    58       var parametricBranches = gardener.GetAllSubTrees(tree).Where(branch => branch.Function.GetVariable(FunctionBase.MANIPULATION) != null);
     58      var parametricBranches = gardener.GetAllSubTrees(tree).Where(branch => branch.Manipulator!= null);
    5959      foreach(IFunctionTree subTree in parametricBranches) {
    60         IOperator mutation = (IOperator)subTree.Function.GetVariable(FunctionBase.MANIPULATION).Value;
     60        IOperator mutation = subTree.Manipulator;
    6161
    6262        // store all local variables into a temporary scope
Note: See TracChangeset for help on using the changeset viewer.