Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2364


Ignore:
Timestamp:
09/16/09 14:26:29 (15 years ago)
Author:
mkommend
Message:

added FunctionTreeIterator to HeuristicLab.GP.Interfaces (ticket #749)

Location:
trunk/sources
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.Interfaces/3.3/HeuristicLab.GP.Interfaces-3.3.csproj

    r2235 r2364  
    8080  </ItemGroup>
    8181  <ItemGroup>
     82    <Compile Include="FunctionTreeIterator.cs" />
    8283    <Compile Include="IFunctionTreeSerializer.cs">
    8384      <SubType>Code</SubType>
  • trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/BaseClasses/TreeEvaluatorBase.cs

    r2328 r2364  
    6464      codeArr = new Instr[functionTree.GetSize()];
    6565      int i = 0;
    66       foreach (IFunctionTree tree in IteratePrefix(functionTree)) {
     66      foreach (IFunctionTree tree in FunctionTreeIterator.IteratePrefix(functionTree)) {
    6767        codeArr[i++] = TranslateToInstr(tree);
    6868      }
    69     }
    70 
    71     private IEnumerable<IFunctionTree> IteratePrefix(IFunctionTree functionTree) {
    72       List<IFunctionTree> prefixForm = new List<IFunctionTree>();
    73       prefixForm.Add(functionTree);
    74       foreach (IFunctionTree subTree in functionTree.SubTrees) {
    75         prefixForm.AddRange(IteratePrefix(subTree));
    76       }
    77       return prefixForm;
    7869    }
    7970
Note: See TracChangeset for help on using the changeset viewer.