Free cookie consent management tool by TermsFeed Policy Generator

Changeset 225


Ignore:
Timestamp:
05/07/08 01:39:57 (17 years ago)
Author:
gkronber
Message:

deleted obsolete class FunctionTree (ticket #139)

Location:
branches/ExperimentalFunctionsBaking
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • branches/ExperimentalFunctionsBaking/HeuristicLab.Functions.csproj

    r223 r225  
    5757    <Compile Include="Constant.cs" />
    5858    <Compile Include="GreaterThan.cs" />
    59     <Compile Include="FunctionTree.cs" />
    6059    <Compile Include="IfThenElse.cs">
    6160      <SubType>Code</SubType>
  • branches/ExperimentalFunctionsBaking/ProgrammableFunction.cs

    r220 r225  
    187187  }
    188188
    189   class ProgrammableFunctionTree : FunctionTree {
    190     private ProgrammableFunction progFun;
    191     public ProgrammableFunctionTree() : base() { }
    192     public ProgrammableFunctionTree(ProgrammableFunction progFun) : base(progFun) {
    193       this.progFun = progFun;
    194     }
    195     public override double Evaluate(Dataset dataset, int sampleIndex) {
    196       // evaluate sub-trees
    197       double[] evaluationResults = new double[SubTrees.Count];
    198       for(int subTree = 0; subTree < SubTrees.Count; subTree++) {
    199         evaluationResults[subTree] = SubTrees[subTree].Evaluate(dataset, sampleIndex);
    200       }
    201 
    202       // collect parameters
    203       object[] parameters = new object[LocalVariables.Count + 3];
    204       parameters[0] = dataset;
    205       parameters[1] = sampleIndex;
    206       int i = 2;
    207       // all local variables are available in the custom function
    208       foreach(IVariable variable in LocalVariables) {
    209         parameters[i] = variable;
    210         i++;
    211       }
    212       parameters[i] = evaluationResults;
    213       return progFun.Call(parameters);
    214     }
    215   }
     189  //class ProgrammableFunctionTree : FunctionTree {
     190  //  private ProgrammableFunction progFun;
     191  //  public ProgrammableFunctionTree() : base() { }
     192  //  public ProgrammableFunctionTree(ProgrammableFunction progFun) : base(progFun) {
     193  //    this.progFun = progFun;
     194  //  }
     195  //  public override double Evaluate(Dataset dataset, int sampleIndex) {
     196  //    // evaluate sub-trees
     197  //    double[] evaluationResults = new double[SubTrees.Count];
     198  //    for(int subTree = 0; subTree < SubTrees.Count; subTree++) {
     199  //      evaluationResults[subTree] = SubTrees[subTree].Evaluate(dataset, sampleIndex);
     200  //    }
     201
     202  //    // collect parameters
     203  //    object[] parameters = new object[LocalVariables.Count + 3];
     204  //    parameters[0] = dataset;
     205  //    parameters[1] = sampleIndex;
     206  //    int i = 2;
     207  //    // all local variables are available in the custom function
     208  //    foreach(IVariable variable in LocalVariables) {
     209  //      parameters[i] = variable;
     210  //      i++;
     211  //    }
     212  //    parameters[i] = evaluationResults;
     213  //    return progFun.Call(parameters);
     214  //  }
     215  //}
    216216}
Note: See TracChangeset for help on using the changeset viewer.