Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/11 13:51:04 (14 years ago)
Author:
gkronber
Message:

#1418 Fixed compiler errors in symbolic expression tree encoding

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs

    r5499 r5510  
    4141    }
    4242
    43     protected override void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree) {
     43    protected override void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
    4444      ChangeNodeType(random, symbolicExpressionTree);
    4545    }
    4646
    47     public static void ChangeNodeType(IRandom random, SymbolicExpressionTree symbolicExpressionTree) {
     47    public static void ChangeNodeType(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
    4848
    4949      // select any node as parent (except the root node)
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs

    r5499 r5510  
    5454    }
    5555
    56     protected override void Manipulate(IRandom random, SymbolicExpressionTree tree) {
     56    protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) {
    5757      tree.Root.ForEachNodePostfix(node => {
    5858        if (node.HasLocalParameters) {
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs

    r5499 r5510  
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2727using HeuristicLab.Parameters;
     28using System.Collections.Generic;
    2829
    2930namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     
    5455    }
    5556
    56     protected override void Manipulate(IRandom random, SymbolicExpressionTree tree) {
    57       var parametricNodes = from node in tree.IterateNodesPrefix()
    58                             where node.HasLocalParameters
    59                             select node;
    60       if (parametricNodes.Count() > 0) {
     57    protected override void Manipulate(IRandom random, ISymbolicExpressionTree tree) {
     58      List<ISymbolicExpressionTreeNode> parametricNodes = new List<ISymbolicExpressionTreeNode>();
     59      tree.Root.ForEachNodePostfix(n => {
     60        if (n.HasLocalParameters) parametricNodes.Add(n);
     61      });
     62      if (parametricNodes.Count > 0) {
    6163        var selectedPoint = parametricNodes.SelectRandom(random);
    62 
    6364        selectedPoint.ShakeLocalParameters(random, ShakingFactor.Value);
    6465      }
  • branches/DataAnalysis Refactoring/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs

    r5499 r5510  
    3636
    3737    #region Parameter Properties
    38     public ILookupParameter<SymbolicExpressionTree> SymbolicExpressionTreeParameter {
    39       get { return (ILookupParameter<SymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     38    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
     39      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    4040    }
    4141    #endregion
    4242
    4343    #region Properties
    44     public SymbolicExpressionTree SymbolicExpressionTree {
     44    public ISymbolicExpressionTree SymbolicExpressionTree {
    4545      get { return SymbolicExpressionTreeParameter.ActualValue; }
    4646    }
     
    5252    public SymbolicExpressionTreeManipulator()
    5353      : base() {
    54       Parameters.Add(new LookupParameter<SymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
     54      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
    5555    }
    5656
    5757    public sealed override IOperation Apply() {
    58       SymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
     58      ISymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
    5959      Manipulate(RandomParameter.ActualValue, tree);
    6060
     
    6262    }
    6363
    64     protected abstract void Manipulate(IRandom random, SymbolicExpressionTree symbolicExpressionTree);
     64    protected abstract void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree);
    6565  }
    6666}
Note: See TracChangeset for help on using the changeset viewer.