Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/01/17 09:28:34 (8 years ago)
Author:
pkimmesw
Message:

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

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  
    4949
    5050    public override string GetErcValue(IRandom random) {
    51       if (random.NextDouble().IsAlmost(NewStringProbability) || generatedValues.Count == 0) {
     51      if (random.NextDouble() < NewStringProbability || generatedValues.Count == 0) {
    5252        var value = StringGenerator.RandomString(
    5353          AllowLowercaseLetters,
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/StringVector/StringVectorConstantsErc.cs

    r14952 r15017  
    1616
    1717    public StringVectorConstantsErc() : this(false, 1d) { }
     18    public StringVectorConstantsErc(params string[][] arrays) : this(true, 1d, arrays.Select(x => new StringArray(x)).ToArray()) { }
    1819    public StringVectorConstantsErc(params StringArray[] arrays) : this(true, 1d, arrays) { }
    1920
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Views/ErcOptionsView.Designer.cs

    r14952 r15017  
    3434      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    3535      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    36       this.nameTextBox.Location = new System.Drawing.Point(63, 0);
    37       this.nameTextBox.Size = new System.Drawing.Size(645, 20);
     36      this.nameTextBox.Location = new System.Drawing.Point(75, 0);
     37      this.nameTextBox.Size = new System.Drawing.Size(633, 20);
    3838      //
    3939      // infoLabel
     
    5454      this.possibilityTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    5555            | 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);
    5757      this.possibilityTextBox.Name = "possibilityTextBox";
    58       this.possibilityTextBox.Size = new System.Drawing.Size(670, 20);
    59       this.possibilityTextBox.TabIndex = 1;
     58      this.possibilityTextBox.Size = new System.Drawing.Size(658, 20);
     59      this.possibilityTextBox.TabIndex = 2;
    6060      //
    6161      // ErcOptionListView
     
    6969      this.ErcOptionListView.Name = "ErcOptionListView";
    7070      this.ErcOptionListView.ReadOnly = false;
     71      this.ErcOptionListView.ShowDetails = true;
    7172      this.ErcOptionListView.Size = new System.Drawing.Size(733, 434);
    7273      this.ErcOptionListView.TabIndex = 3;
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Views/ErcOptionsView.cs

    r14952 r15017  
    1515
    1616      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      }
    1724    }
    1825
    1926    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
    2032      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);
    2335      } else {
    24         possibilityTextBox.Text = "0 %";
     36        possibilityTextBox.Text = "0%";
    2537        e.Cancel = true;
    2638      }
     
    3749        base.Content = value;
    3850      }
     51    }
     52
     53    protected override void OnReadOnlyChanged() {
     54      base.OnReadOnlyChanged();
     55
     56      possibilityTextBox.ReadOnly = ReadOnly;
    3957    }
    4058
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Views/ErcOptionsView.resx

    r14952 r15017  
    121121    <value>17, 17</value>
    122122  </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>
    126123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
    127124    <value>140, 17</value>
Note: See TracChangeset for help on using the changeset viewer.