Changeset 15017 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc
- Timestamp:
- 06/01/17 09:28:34 (8 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/String/StringRandomErc.cs
r14952 r15017 49 49 50 50 public override string GetErcValue(IRandom random) { 51 if (random.NextDouble() .IsAlmost(NewStringProbability)|| generatedValues.Count == 0) {51 if (random.NextDouble() < NewStringProbability || generatedValues.Count == 0) { 52 52 var value = StringGenerator.RandomString( 53 53 AllowLowercaseLetters, -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/StringVector/StringVectorConstantsErc.cs
r14952 r15017 16 16 17 17 public StringVectorConstantsErc() : this(false, 1d) { } 18 public StringVectorConstantsErc(params string[][] arrays) : this(true, 1d, arrays.Select(x => new StringArray(x)).ToArray()) { } 18 19 public StringVectorConstantsErc(params StringArray[] arrays) : this(true, 1d, arrays) { } 19 20 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Views/ErcOptionsView.Designer.cs
r14952 r15017 34 34 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 35 35 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 36 this.nameTextBox.Location = new System.Drawing.Point( 63, 0);37 this.nameTextBox.Size = new System.Drawing.Size(6 45, 20);36 this.nameTextBox.Location = new System.Drawing.Point(75, 0); 37 this.nameTextBox.Size = new System.Drawing.Size(633, 20); 38 38 // 39 39 // infoLabel … … 54 54 this.possibilityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 55 55 | System.Windows.Forms.AnchorStyles.Right))); 56 this.possibilityTextBox.Location = new System.Drawing.Point( 63, 25);56 this.possibilityTextBox.Location = new System.Drawing.Point(75, 25); 57 57 this.possibilityTextBox.Name = "possibilityTextBox"; 58 this.possibilityTextBox.Size = new System.Drawing.Size(6 70, 20);59 this.possibilityTextBox.TabIndex = 1;58 this.possibilityTextBox.Size = new System.Drawing.Size(658, 20); 59 this.possibilityTextBox.TabIndex = 2; 60 60 // 61 61 // ErcOptionListView … … 69 69 this.ErcOptionListView.Name = "ErcOptionListView"; 70 70 this.ErcOptionListView.ReadOnly = false; 71 this.ErcOptionListView.ShowDetails = true; 71 72 this.ErcOptionListView.Size = new System.Drawing.Size(733, 434); 72 73 this.ErcOptionListView.TabIndex = 3; -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Views/ErcOptionsView.cs
r14952 r15017 15 15 16 16 possibilityTextBox.Validating += PossibilityTextBoxValidating; 17 possibilityTextBox.KeyDown += PossibilityTextBoxKeyDown; 18 } 19 20 private void PossibilityTextBoxKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { 21 if (e.KeyCode == System.Windows.Forms.Keys.Enter) { 22 Validate(); 23 } 17 24 } 18 25 19 26 private void PossibilityTextBoxValidating(object sender, System.ComponentModel.CancelEventArgs e) { 27 var text = possibilityTextBox.Text.Trim(); 28 if (text.EndsWith("%")) { 29 text = text.Substring(0, text.Length - 1); 30 } 31 20 32 double value; 21 if (double.TryParse( possibilityTextBox.Text, out value)) {22 possibilityTextBox.Text = value.ToString(PERCENTAGE_FORMAT);33 if (double.TryParse(text, out value)) { 34 possibilityTextBox.Text = (value / 100.0).ToString(PERCENTAGE_FORMAT); 23 35 } else { 24 possibilityTextBox.Text = "0 36 possibilityTextBox.Text = "0%"; 25 37 e.Cancel = true; 26 38 } … … 37 49 base.Content = value; 38 50 } 51 } 52 53 protected override void OnReadOnlyChanged() { 54 base.OnReadOnlyChanged(); 55 56 possibilityTextBox.ReadOnly = ReadOnly; 39 57 } 40 58 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Views/ErcOptionsView.resx
r14952 r15017 121 121 <value>17, 17</value> 122 122 </metadata> 123 <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">124 <value>17, 17</value>125 </metadata>126 123 <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> 127 124 <value>140, 17</value>
Note: See TracChangeset
for help on using the changeset viewer.