Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/31/10 08:31:29 (14 years ago)
Author:
gkronber
Message:

Removed fields for tree size and tree height in GeneticProgrammingModel instead iterate through the tree to determine the size/height whenever it is needed. #1025 (Incorrect size/height values for trees)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/sources/HeuristicLab.GP/3.3/GeneticProgrammingModel.cs

    r2787 r3873  
    3636      set {
    3737        functionTree = value;
    38         Size = functionTree.GetSize();
    39         Height = functionTree.GetHeight();
    4038      }
    4139    }
    42     public int Size { get; set; }
    43     public int Height { get; set; }
     40    public int Size { get { return functionTree.GetSize(); } }
     41    public int Height { get { return functionTree.GetHeight(); } }
    4442
    4543    public GeneticProgrammingModel()
     
    9997      // check if there is data for the tree node that needs to be restored and restore the data if needed
    10098      var dataNode = fNode.SelectSingleNode("Data");
    101       if (dataNode!=null) tree.Populate(dataNode, restoredObjects);
     99      if (dataNode != null) tree.Populate(dataNode, restoredObjects);
    102100      nodeIndex++;
    103101      for (int i = 0; i < subTrees; i++) {
Note: See TracChangeset for help on using the changeset viewer.