Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/29/09 18:28:45 (15 years ago)
Author:
gkronber
Message:

GP Refactoring #713

  • introduced a plugin for GP interfaces
  • created a new interface IGeneticProgrammingModel which represents GP models in HL scopes instead of IFunctionTree
  • changed interfaces IFunction and IFunctionTree
  • moved some files to new directories (general housekeeping)
  • changed all GP operators and engines to work with IGeneticProgrammingModels
  • removed parameters TreeSize and TreeHeight in all GP operators
  • changed parameter OperatorLibrary to FunctionLibrary in all GP operators
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GP-Refactoring-713/sources/HeuristicLab.GP/3.3/Logging/TreeArityAnalyser.cs

    r698 r2210  
    3030using HeuristicLab.Constraints;
    3131using System.Diagnostics;
     32using HeuristicLab.GP.Interfaces;
    3233
    3334namespace HeuristicLab.GP {
     
    4344    public TreeArityAnalyser()
    4445      : base() {
    45       AddVariableInfo(new VariableInfo("FunctionTree", "The tree to mutate", typeof(IFunctionTree), VariableKind.In));
     46      AddVariableInfo(new VariableInfo("FunctionTree", "The tree to analyse", typeof(IGeneticProgrammingModel), VariableKind.In));
    4647      AddVariableInfo(new VariableInfo("Histogram", "The histogram of arities over all functions in all functiontrees", typeof(ItemList<ItemList<IntData>>), VariableKind.New | VariableKind.Out));
    4748    }
     
    6970
    7071    private ItemList<ItemList<IntData>> GetArityHistogram(IScope subScope) {
    71       IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", subScope, false);
     72      IGeneticProgrammingModel gpModel = GetVariableValue<IGeneticProgrammingModel>("FunctionTree", subScope, false);
    7273      List<int> arities = new List<int>();
    73       Arities(tree, arities);
     74      Arities(gpModel.FunctionTree, arities);
    7475      var histogram = arities.GroupBy(x => x, (g, xs) => new { Group = g, Count = xs.Count() }).OrderBy(g=>g.Group); // count number of distinct arities
    7576      ItemList<ItemList<IntData>> result = new ItemList<ItemList<IntData>>();
Note: See TracChangeset for help on using the changeset viewer.