Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Data/Tree/ExpressionTree.cs @ 14727

Last change on this file since 14727 was 14727, checked in by pkimmesw, 7 years ago

#2665 PushGP HL Integration, Views, Parameters

File size: 575 bytes
Line 
1namespace HeuristicLab.Problems.ProgramSynthesis.Push.Data {
2  using HeuristicLab.Problems.ProgramSynthesis.Push.Expressions;
3
4  public class ExpressionTree {
5    public ExpressionNode Root { get; set; }
6
7    public static ExpressionTree BuildTree(ExecExpandExpression program) {
8      var tree = new ExpressionTree { Root = new ExpressionNode(program) };
9
10      for (var i = program.State.Expressions.Count - 1; i >= 0; i--) {
11        tree.Root.Children.Add(ExpressionNode.CreateNode(program.State.Expressions[i]));
12      }
13
14      return tree;
15    }
16  }
17}
Note: See TracBrowser for help on using the repository browser.