- Timestamp:
- 11/17/11 11:51:09 (12 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.Designer.cs
r6803 r7012 52 52 this.maxTreeDepthTextBox = new System.Windows.Forms.TextBox(); 53 53 this.generateSampleTreeButton = new System.Windows.Forms.Button(); 54 this.treeCreatorComboBox = new System.Windows.Forms.ComboBox(); 55 this.treeCreatorLabel = new System.Windows.Forms.Label(); 54 56 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 55 57 this.sampleTreeGroupBox.SuspendLayout(); … … 69 71 // sampleTreeGroupBox 70 72 // 71 this.sampleTreeGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 72 | System.Windows.Forms.AnchorStyles.Left)73 | System.Windows.Forms.AnchorStyles.Right)));73 this.sampleTreeGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 74 | System.Windows.Forms.AnchorStyles.Left) 75 | System.Windows.Forms.AnchorStyles.Right))); 74 76 this.sampleTreeGroupBox.Controls.Add(this.sampleTreeView); 75 this.sampleTreeGroupBox.Location = new System.Drawing.Point(3, 1 07);77 this.sampleTreeGroupBox.Location = new System.Drawing.Point(3, 134); 76 78 this.sampleTreeGroupBox.Name = "sampleTreeGroupBox"; 77 this.sampleTreeGroupBox.Size = new System.Drawing.Size(431, 2 92);79 this.sampleTreeGroupBox.Size = new System.Drawing.Size(431, 265); 78 80 this.sampleTreeGroupBox.TabIndex = 3; 79 81 this.sampleTreeGroupBox.TabStop = false; … … 89 91 this.sampleTreeView.Name = "sampleTreeView"; 90 92 this.sampleTreeView.ReadOnly = false; 91 this.sampleTreeView.Size = new System.Drawing.Size(425, 2 73);93 this.sampleTreeView.Size = new System.Drawing.Size(425, 246); 92 94 this.sampleTreeView.TabIndex = 0; 93 95 // … … 112 114 // maxTreeLengthTextBox 113 115 // 114 this.maxTreeLengthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 115 | System.Windows.Forms.AnchorStyles.Right)));116 this.maxTreeLengthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 117 | System.Windows.Forms.AnchorStyles.Right))); 116 118 this.maxTreeLengthTextBox.Location = new System.Drawing.Point(93, 26); 117 119 this.maxTreeLengthTextBox.Name = "maxTreeLengthTextBox"; … … 124 126 // maxTreeDepthTextBox 125 127 // 126 this.maxTreeDepthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 127 | System.Windows.Forms.AnchorStyles.Right)));128 this.maxTreeDepthTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 129 | System.Windows.Forms.AnchorStyles.Right))); 128 130 this.maxTreeDepthTextBox.Location = new System.Drawing.Point(93, 52); 129 131 this.maxTreeDepthTextBox.Name = "maxTreeDepthTextBox"; … … 136 138 // generateSampleTreeButton 137 139 // 138 this.generateSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 139 | System.Windows.Forms.AnchorStyles.Right)));140 this.generateSampleTreeButton.Location = new System.Drawing.Point( 3, 78);140 this.generateSampleTreeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 141 | System.Windows.Forms.AnchorStyles.Right))); 142 this.generateSampleTreeButton.Location = new System.Drawing.Point(6, 105); 141 143 this.generateSampleTreeButton.Name = "generateSampleTreeButton"; 142 144 this.generateSampleTreeButton.Size = new System.Drawing.Size(431, 23); … … 146 148 this.generateSampleTreeButton.Click += new System.EventHandler(this.generateSampleTreeButton_Click); 147 149 // 150 // treeCreatorComboBox 151 // 152 this.treeCreatorComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 153 | System.Windows.Forms.AnchorStyles.Right))); 154 this.treeCreatorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; 155 this.treeCreatorComboBox.FormattingEnabled = true; 156 this.treeCreatorComboBox.Location = new System.Drawing.Point(93, 78); 157 this.treeCreatorComboBox.Name = "treeCreatorComboBox"; 158 this.treeCreatorComboBox.Size = new System.Drawing.Size(341, 21); 159 this.treeCreatorComboBox.TabIndex = 9; 160 this.treeCreatorComboBox.SelectedIndexChanged += new System.EventHandler(this.treeCreatorComboBox_SelectedIndexChanged); 161 // 162 // treeCreatorLabel 163 // 164 this.treeCreatorLabel.AutoSize = true; 165 this.treeCreatorLabel.Location = new System.Drawing.Point(3, 81); 166 this.treeCreatorLabel.Name = "treeCreatorLabel"; 167 this.treeCreatorLabel.Size = new System.Drawing.Size(69, 13); 168 this.treeCreatorLabel.TabIndex = 10; 169 this.treeCreatorLabel.Text = "Tree Creator:"; 170 // 148 171 // SymbolicExpressionGrammarSampleExpressionTreeView 149 172 // 150 173 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 151 174 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 175 this.Controls.Add(this.treeCreatorLabel); 152 176 this.Controls.Add(this.sampleTreeGroupBox); 153 177 this.Controls.Add(this.maxTreeDepthLabel); 154 178 this.Controls.Add(this.maxTreeLengthTextBox); 179 this.Controls.Add(this.treeCreatorComboBox); 155 180 this.Controls.Add(this.maxTreeLengthLabel); 156 181 this.Controls.Add(this.maxTreeDepthTextBox); … … 161 186 this.Controls.SetChildIndex(this.maxTreeDepthTextBox, 0); 162 187 this.Controls.SetChildIndex(this.maxTreeLengthLabel, 0); 188 this.Controls.SetChildIndex(this.treeCreatorComboBox, 0); 163 189 this.Controls.SetChildIndex(this.maxTreeLengthTextBox, 0); 164 190 this.Controls.SetChildIndex(this.maxTreeDepthLabel, 0); 165 191 this.Controls.SetChildIndex(this.sampleTreeGroupBox, 0); 192 this.Controls.SetChildIndex(this.treeCreatorLabel, 0); 166 193 this.Controls.SetChildIndex(this.nameTextBox, 0); 167 194 this.Controls.SetChildIndex(this.infoLabel, 0); … … 183 210 private System.Windows.Forms.Button generateSampleTreeButton; 184 211 private GraphicalSymbolicExpressionTreeView sampleTreeView; 212 private System.Windows.Forms.ComboBox treeCreatorComboBox; 213 private System.Windows.Forms.Label treeCreatorLabel; 185 214 } 186 215 } -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionGrammarSampleExpressionTreeView.cs
r6803 r7012 36 36 public SymbolicExpressionGrammarSampleExpressionTreeView() { 37 37 InitializeComponent(); 38 random = new MersenneTwister(); 38 random = new MersenneTwister(); 39 39 maxSampleTreeLength = int.Parse(maxTreeLengthTextBox.Text); 40 40 maxSampleTreeDepth = int.Parse(maxTreeDepthTextBox.Text); 41 foreach (var treeCreator in ApplicationManager.Manager.GetInstances<ISymbolicExpressionTreeCreator>()) { 42 treeCreatorComboBox.Items.Add(treeCreator); 43 } 44 treeCreatorComboBox.SelectedIndex = 0; 41 45 } 42 46 … … 97 101 private void UpdateSampleTreeView() { 98 102 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); 100 105 foreach (var node in tree.Root.IterateNodesPrefix().OfType<SymbolicExpressionTreeTopLevelNode>()) 101 106 node.SetGrammar(null); … … 147 152 } 148 153 #endregion 154 155 private void treeCreatorComboBox_SelectedIndexChanged(object sender, EventArgs e) { 156 } 149 157 } 150 158 }
Note: See TracChangeset
for help on using the changeset viewer.