Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/17/11 11:51:09 (12 years ago)
Author:
bburlacu
Message:

#1654: Updated Full-, Grow- and RampedHalfAndHalf tree creators so that the Create call has the exact same signature for all of them (including the probabilistic tree creator); adjusted tests. Added CreateTree interface method and tree creator selection mechanism in the Sample Tree View.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs

    r6803 r7012  
    3636    public SymbolicExpressionGrammarSampleExpressionTreeView() {
    3737      InitializeComponent();
    38       random = new MersenneTwister();
     38      random = new MersenneTwister();   
    3939      maxSampleTreeLength = int.Parse(maxTreeLengthTextBox.Text);
    4040      maxSampleTreeDepth = int.Parse(maxTreeDepthTextBox.Text);
     41      foreach (var treeCreator in ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeCreator>()) {
     42        treeCreatorComboBox.Items.Add(treeCreator);
     43      }
     44      treeCreatorComboBox.SelectedIndex = 0;
    4145    }
    4246
     
    97101    private void UpdateSampleTreeView() {
    98102      try {
    99         ISymbolicExpressionTree tree = ProbabilisticTreeCreator.Create(random, Content, MaxSampleTreeLength, MaxSampleTreeDepth);
     103        ISymbolicExpressionTreeCreator creator = (SymbolicExpressionTreeCreator)treeCreatorComboBox.SelectedItem;
     104        ISymbolicExpressionTree tree = creator.CreateTree(random, Content, MaxSampleTreeLength, MaxSampleTreeDepth);
    100105        foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>())
    101106          node.SetGrammar(null);
     
    147152    }
    148153    #endregion
     154
     155    private void treeCreatorComboBox_SelectedIndexChanged(object sender, EventArgs e) {
     156    }
    149157  }
    150158}
Note: See TracChangeset for help on using the changeset viewer.