Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/01/10 08:52:32 (14 years ago)
Author:
gkronber
Message:

Created a specialized view for function library injectors which allows full configuration of the function library. #748 (FunctionLibraryView is empty)

Location:
trunk/sources/HeuristicLab.GP.Algorithms/3.2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.GP.Algorithms/3.2/OffSpringSelectionGpEditor.Designer.cs

    r2341 r2728  
    4646    /// </summary>
    4747    private void InitializeComponent() {
     48      this.components = new System.ComponentModel.Container();
    4849      this.executeButton = new System.Windows.Forms.Button();
    4950      this.tabControl = new System.Windows.Forms.TabControl();
     
    7273      this.resetButton = new System.Windows.Forms.Button();
    7374      this.cloneEngineButton = new System.Windows.Forms.Button();
     75      this.functionLibraryInjectorViewButton = new System.Windows.Forms.Button();
     76      this.functionLibraryInjectorSetButton = new System.Windows.Forms.Button();
     77      this.functionLibraryInjectorTextBox = new System.Windows.Forms.TextBox();
     78      this.label1 = new System.Windows.Forms.Label();
     79      this.comparisonFactorTextBox = new System.Windows.Forms.TextBox();
     80      this.label2 = new System.Windows.Forms.Label();
     81      this.successRatioLimitTextBox = new System.Windows.Forms.TextBox();
     82      this.label3 = new System.Windows.Forms.Label();
     83      this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    7484      this.tabControl.SuspendLayout();
    7585      this.parametersTabPage.SuspendLayout();
    7686      this.scopesTabPage.SuspendLayout();
     87      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    7788      this.SuspendLayout();
    7889      //
     
    103114      // parametersTabPage
    104115      //
     116      this.parametersTabPage.Controls.Add(this.successRatioLimitTextBox);
     117      this.parametersTabPage.Controls.Add(this.label3);
     118      this.parametersTabPage.Controls.Add(this.comparisonFactorTextBox);
     119      this.parametersTabPage.Controls.Add(this.label2);
     120      this.parametersTabPage.Controls.Add(this.functionLibraryInjectorViewButton);
     121      this.parametersTabPage.Controls.Add(this.functionLibraryInjectorSetButton);
     122      this.parametersTabPage.Controls.Add(this.functionLibraryInjectorTextBox);
     123      this.parametersTabPage.Controls.Add(this.label1);
    105124      this.parametersTabPage.Controls.Add(this.selectionPressureTextBox);
    106125      this.parametersTabPage.Controls.Add(this.selectionPressureLabel);
     
    132151      //
    133152      this.selectionPressureTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    134       this.selectionPressureTextBox.Location = new System.Drawing.Point(218, 130);
     153      this.selectionPressureTextBox.Location = new System.Drawing.Point(218, 234);
    135154      this.selectionPressureTextBox.Name = "selectionPressureTextBox";
    136155      this.selectionPressureTextBox.Size = new System.Drawing.Size(186, 20);
    137156      this.selectionPressureTextBox.TabIndex = 17;
     157      this.selectionPressureTextBox.TextChanged += new System.EventHandler(this.selectionPressureTextBox_TextChanged);
    138158      //
    139159      // selectionPressureLabel
     
    141161      this.selectionPressureLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    142162      this.selectionPressureLabel.AutoSize = true;
    143       this.selectionPressureLabel.Location = new System.Drawing.Point(65, 133);
     163      this.selectionPressureLabel.Location = new System.Drawing.Point(65, 237);
    144164      this.selectionPressureLabel.Name = "selectionPressureLabel";
    145165      this.selectionPressureLabel.Size = new System.Drawing.Size(145, 13);
     
    150170      //
    151171      this.viewProblemInitializationButton.Anchor = System.Windows.Forms.AnchorStyles.None;
    152       this.viewProblemInitializationButton.Location = new System.Drawing.Point(410, 241);
     172      this.viewProblemInitializationButton.Location = new System.Drawing.Point(410, 281);
    153173      this.viewProblemInitializationButton.Name = "viewProblemInitializationButton";
    154174      this.viewProblemInitializationButton.Size = new System.Drawing.Size(53, 20);
     
    161181      //
    162182      this.setProblemInitializationButton.Anchor = System.Windows.Forms.AnchorStyles.None;
    163       this.setProblemInitializationButton.Location = new System.Drawing.Point(469, 241);
     183      this.setProblemInitializationButton.Location = new System.Drawing.Point(469, 281);
    164184      this.setProblemInitializationButton.Name = "setProblemInitializationButton";
    165185      this.setProblemInitializationButton.Size = new System.Drawing.Size(43, 20);
     
    172192      //
    173193      this.problemInitializationTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    174       this.problemInitializationTextBox.Location = new System.Drawing.Point(218, 241);
     194      this.problemInitializationTextBox.Location = new System.Drawing.Point(218, 281);
    175195      this.problemInitializationTextBox.Name = "problemInitializationTextBox";
    176196      this.problemInitializationTextBox.ReadOnly = true;
     
    192212      //
    193213      this.elitesTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    194       this.elitesTextBox.Location = new System.Drawing.Point(218, 182);
     214      this.elitesTextBox.Location = new System.Drawing.Point(218, 104);
    195215      this.elitesTextBox.Name = "elitesTextBox";
    196216      this.elitesTextBox.Size = new System.Drawing.Size(186, 20);
    197217      this.elitesTextBox.TabIndex = 11;
     218      this.elitesTextBox.TextChanged += new System.EventHandler(this.elitesTextBox_TextChanged);
    198219      //
    199220      // problemInitializationLabel
     
    201222      this.problemInitializationLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    202223      this.problemInitializationLabel.AutoSize = true;
    203       this.problemInitializationLabel.Location = new System.Drawing.Point(65, 244);
     224      this.problemInitializationLabel.Location = new System.Drawing.Point(65, 284);
    204225      this.problemInitializationLabel.Name = "problemInitializationLabel";
    205226      this.problemInitializationLabel.Size = new System.Drawing.Size(105, 13);
     
    211232      this.elitesLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    212233      this.elitesLabel.AutoSize = true;
    213       this.elitesLabel.Location = new System.Drawing.Point(66, 185);
     234      this.elitesLabel.Location = new System.Drawing.Point(66, 107);
    214235      this.elitesLabel.Name = "elitesLabel";
    215236      this.elitesLabel.Size = new System.Drawing.Size(35, 13);
     
    220241      //
    221242      this.mutationRateTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    222       this.mutationRateTextBox.Location = new System.Drawing.Point(218, 156);
     243      this.mutationRateTextBox.Location = new System.Drawing.Point(218, 130);
    223244      this.mutationRateTextBox.Name = "mutationRateTextBox";
    224245      this.mutationRateTextBox.Size = new System.Drawing.Size(186, 20);
    225246      this.mutationRateTextBox.TabIndex = 9;
     247      this.mutationRateTextBox.TextChanged += new System.EventHandler(this.mutationRateTextBox_TextChanged);
    226248      //
    227249      // mutationRateLabel
     
    229251      this.mutationRateLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    230252      this.mutationRateLabel.AutoSize = true;
    231       this.mutationRateLabel.Location = new System.Drawing.Point(66, 159);
     253      this.mutationRateLabel.Location = new System.Drawing.Point(66, 133);
    232254      this.mutationRateLabel.Name = "mutationRateLabel";
    233255      this.mutationRateLabel.Size = new System.Drawing.Size(77, 13);
     
    238260      //
    239261      this.maximumEvaluatedSolutionsTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    240       this.maximumEvaluatedSolutionsTextBox.Location = new System.Drawing.Point(218, 104);
     262      this.maximumEvaluatedSolutionsTextBox.Location = new System.Drawing.Point(218, 208);
    241263      this.maximumEvaluatedSolutionsTextBox.Name = "maximumEvaluatedSolutionsTextBox";
    242264      this.maximumEvaluatedSolutionsTextBox.Size = new System.Drawing.Size(186, 20);
    243265      this.maximumEvaluatedSolutionsTextBox.TabIndex = 7;
     266      this.maximumEvaluatedSolutionsTextBox.TextChanged += new System.EventHandler(this.maximumEvaluatedSolutionsTextBox_TextChanged);
    244267      //
    245268      // maxEvaluatedSolutionsLabel
     
    247270      this.maxEvaluatedSolutionsLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    248271      this.maxEvaluatedSolutionsLabel.AutoSize = true;
    249       this.maxEvaluatedSolutionsLabel.Location = new System.Drawing.Point(65, 107);
     272      this.maxEvaluatedSolutionsLabel.Location = new System.Drawing.Point(65, 211);
    250273      this.maxEvaluatedSolutionsLabel.Name = "maxEvaluatedSolutionsLabel";
    251274      this.maxEvaluatedSolutionsLabel.Size = new System.Drawing.Size(130, 13);
     
    260283      this.randomSeedTextBox.Size = new System.Drawing.Size(186, 20);
    261284      this.randomSeedTextBox.TabIndex = 3;
     285      this.randomSeedTextBox.TextChanged += new System.EventHandler(this.randomSeedTextBox_TextChanged);
    262286      //
    263287      // populationSizeTextBox
     
    268292      this.populationSizeTextBox.Size = new System.Drawing.Size(186, 20);
    269293      this.populationSizeTextBox.TabIndex = 5;
     294      this.populationSizeTextBox.TextChanged += new System.EventHandler(this.populationSizeTextBox_TextChanged);
    270295      //
    271296      // setRandomSeedRandomlyLabel
     
    353378      this.cloneEngineButton.UseVisualStyleBackColor = true;
    354379      this.cloneEngineButton.Click += new System.EventHandler(this.cloneEngineButton_Click);
     380      //
     381      // functionLibraryInjectorViewButton
     382      //
     383      this.functionLibraryInjectorViewButton.Anchor = System.Windows.Forms.AnchorStyles.None;
     384      this.functionLibraryInjectorViewButton.Location = new System.Drawing.Point(410, 307);
     385      this.functionLibraryInjectorViewButton.Name = "functionLibraryInjectorViewButton";
     386      this.functionLibraryInjectorViewButton.Size = new System.Drawing.Size(53, 20);
     387      this.functionLibraryInjectorViewButton.TabIndex = 20;
     388      this.functionLibraryInjectorViewButton.Text = "View...";
     389      this.functionLibraryInjectorViewButton.UseVisualStyleBackColor = true;
     390      this.functionLibraryInjectorViewButton.Click += new System.EventHandler(this.functionLibraryInjectorViewButton_Click);
     391      //
     392      // functionLibraryInjectorSetButton
     393      //
     394      this.functionLibraryInjectorSetButton.Anchor = System.Windows.Forms.AnchorStyles.None;
     395      this.functionLibraryInjectorSetButton.Location = new System.Drawing.Point(469, 307);
     396      this.functionLibraryInjectorSetButton.Name = "functionLibraryInjectorSetButton";
     397      this.functionLibraryInjectorSetButton.Size = new System.Drawing.Size(43, 20);
     398      this.functionLibraryInjectorSetButton.TabIndex = 21;
     399      this.functionLibraryInjectorSetButton.Text = "Set...";
     400      this.functionLibraryInjectorSetButton.UseVisualStyleBackColor = true;
     401      this.functionLibraryInjectorSetButton.Click += new System.EventHandler(this.functionLibraryInjectorSetButton_Click);
     402      //
     403      // functionLibraryInjectorTextBox
     404      //
     405      this.functionLibraryInjectorTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
     406      this.functionLibraryInjectorTextBox.Location = new System.Drawing.Point(218, 307);
     407      this.functionLibraryInjectorTextBox.Name = "functionLibraryInjectorTextBox";
     408      this.functionLibraryInjectorTextBox.ReadOnly = true;
     409      this.functionLibraryInjectorTextBox.Size = new System.Drawing.Size(186, 20);
     410      this.functionLibraryInjectorTextBox.TabIndex = 19;
     411      //
     412      // label1
     413      //
     414      this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
     415      this.label1.AutoSize = true;
     416      this.label1.Location = new System.Drawing.Point(65, 310);
     417      this.label1.Name = "label1";
     418      this.label1.Size = new System.Drawing.Size(81, 13);
     419      this.label1.TabIndex = 18;
     420      this.label1.Text = "&Function library:";
     421      //
     422      // comparisonFactorTextBox
     423      //
     424      this.comparisonFactorTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
     425      this.comparisonFactorTextBox.Location = new System.Drawing.Point(218, 156);
     426      this.comparisonFactorTextBox.Name = "comparisonFactorTextBox";
     427      this.comparisonFactorTextBox.Size = new System.Drawing.Size(186, 20);
     428      this.comparisonFactorTextBox.TabIndex = 23;
     429      this.comparisonFactorTextBox.TextChanged += new System.EventHandler(this.comparisonFactorTextBox_TextChanged);
     430      //
     431      // label2
     432      //
     433      this.label2.Anchor = System.Windows.Forms.AnchorStyles.None;
     434      this.label2.AutoSize = true;
     435      this.label2.Location = new System.Drawing.Point(66, 159);
     436      this.label2.Name = "label2";
     437      this.label2.Size = new System.Drawing.Size(95, 13);
     438      this.label2.TabIndex = 22;
     439      this.label2.Text = "Comparison factor:";
     440      //
     441      // successRatioLimitTextBox
     442      //
     443      this.successRatioLimitTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
     444      this.successRatioLimitTextBox.Location = new System.Drawing.Point(218, 182);
     445      this.successRatioLimitTextBox.Name = "successRatioLimitTextBox";
     446      this.successRatioLimitTextBox.Size = new System.Drawing.Size(186, 20);
     447      this.successRatioLimitTextBox.TabIndex = 25;
     448      this.successRatioLimitTextBox.TextChanged += new System.EventHandler(this.successRatioLimitTextBox_TextChanged);
     449      //
     450      // label3
     451      //
     452      this.label3.Anchor = System.Windows.Forms.AnchorStyles.None;
     453      this.label3.AutoSize = true;
     454      this.label3.Location = new System.Drawing.Point(66, 185);
     455      this.label3.Name = "label3";
     456      this.label3.Size = new System.Drawing.Size(94, 13);
     457      this.label3.TabIndex = 24;
     458      this.label3.Text = "Success ratio limit:";
     459      //
     460      // errorProvider
     461      //
     462      this.errorProvider.ContainerControl = this;
    355463      //
    356464      // OffspringSelectionGpEditor
     
    369477      this.parametersTabPage.PerformLayout();
    370478      this.scopesTabPage.ResumeLayout(false);
     479      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    371480      this.ResumeLayout(false);
    372481
     
    380489    private System.Windows.Forms.Button abortButton;
    381490    private System.Windows.Forms.Button resetButton;
    382     private System.Windows.Forms.TextBox mutationRateTextBox;
    383     private System.Windows.Forms.Label mutationRateLabel;
    384     private System.Windows.Forms.TextBox populationSizeTextBox;
    385     private System.Windows.Forms.Label populationSizeLabel;
    386491    private System.Windows.Forms.TabPage scopesTabPage;
    387     private System.Windows.Forms.TextBox maximumEvaluatedSolutionsTextBox;
    388     private System.Windows.Forms.Label maxEvaluatedSolutionsLabel;
    389     private System.Windows.Forms.TextBox elitesTextBox;
    390     private System.Windows.Forms.Label elitesLabel;
    391     private System.Windows.Forms.TextBox randomSeedTextBox;
    392     private System.Windows.Forms.Label setRandomSeedRandomlyLabel;
    393     private System.Windows.Forms.Label randomSeedLabel;
    394     private System.Windows.Forms.CheckBox setRandomSeedRandomlyCheckBox;
    395     private System.Windows.Forms.Label problemInitializationLabel;
    396492    private System.Windows.Forms.Button cloneEngineButton;
    397     private System.Windows.Forms.TextBox problemInitializationTextBox;
    398     private System.Windows.Forms.Button setProblemInitializationButton;
    399493    private HeuristicLab.Core.ScopeView scopeView;
    400     private System.Windows.Forms.Button viewProblemInitializationButton;
    401     private System.Windows.Forms.TextBox selectionPressureTextBox;
    402     private System.Windows.Forms.Label selectionPressureLabel;
     494    protected System.Windows.Forms.Button functionLibraryInjectorViewButton;
     495    protected System.Windows.Forms.Button functionLibraryInjectorSetButton;
     496    protected System.Windows.Forms.TextBox functionLibraryInjectorTextBox;
     497    protected System.Windows.Forms.Label label1;
     498    protected System.Windows.Forms.TextBox comparisonFactorTextBox;
     499    protected System.Windows.Forms.Label label2;
     500    protected System.Windows.Forms.TextBox mutationRateTextBox;
     501    protected System.Windows.Forms.Label mutationRateLabel;
     502    protected System.Windows.Forms.TextBox populationSizeTextBox;
     503    protected System.Windows.Forms.Label populationSizeLabel;
     504    protected System.Windows.Forms.TextBox maximumEvaluatedSolutionsTextBox;
     505    protected System.Windows.Forms.Label maxEvaluatedSolutionsLabel;
     506    protected System.Windows.Forms.TextBox elitesTextBox;
     507    protected System.Windows.Forms.Label elitesLabel;
     508    protected System.Windows.Forms.TextBox randomSeedTextBox;
     509    protected System.Windows.Forms.Label setRandomSeedRandomlyLabel;
     510    protected System.Windows.Forms.Label randomSeedLabel;
     511    protected System.Windows.Forms.CheckBox setRandomSeedRandomlyCheckBox;
     512    protected System.Windows.Forms.Label problemInitializationLabel;
     513    protected System.Windows.Forms.TextBox problemInitializationTextBox;
     514    protected System.Windows.Forms.Button setProblemInitializationButton;
     515    protected System.Windows.Forms.Button viewProblemInitializationButton;
     516    protected System.Windows.Forms.TextBox selectionPressureTextBox;
     517    protected System.Windows.Forms.Label selectionPressureLabel;
     518    protected System.Windows.Forms.TextBox successRatioLimitTextBox;
     519    protected System.Windows.Forms.Label label3;
     520    private System.Windows.Forms.ErrorProvider errorProvider;
    403521  }
    404522}
  • trunk/sources/HeuristicLab.GP.Algorithms/3.2/OffSpringSelectionGpEditor.cs

    r2591 r2728  
    6464      } else {
    6565        tabControl.Enabled = true;
    66         problemInitializationTextBox.Text = OffspringSelectionGP.ProblemInjector.GetType().Name;
     66        problemInitializationTextBox.Text = OffspringSelectionGP.ProblemInjector.Name;
     67        functionLibraryInjectorTextBox.Text = OffspringSelectionGP.FunctionLibraryInjector.Name;
    6768      }
    6869    }
     
    7677      mutationRateTextBox.DataBindings.Add("Text", OffspringSelectionGP, "MutationRate");
    7778      elitesTextBox.DataBindings.Add("Text", OffspringSelectionGP, "Elites");
     79      comparisonFactorTextBox.DataBindings.Add("Text", OffspringSelectionGP, "ComparisonFactor");
     80      successRatioLimitTextBox.DataBindings.Add("Text", OffspringSelectionGP, "SuccessRatioLimit");
    7881    }
    7982
     
    8184    private void viewProblemInjectorButton_Click(object sender, EventArgs e) {
    8285      IView view = OffspringSelectionGP.ProblemInjector.CreateView();
    83       if(view != null)
     86      if (view != null)
    8487        ControlManager.Manager.ShowControl(view);
    8588    }
     
    8992      if (chooseOperatorDialog.ShowDialog(this) == DialogResult.OK) {
    9093        OffspringSelectionGP.ProblemInjector = chooseOperatorDialog.Operator;
    91         problemInitializationTextBox.Text = OffspringSelectionGP.ProblemInjector.GetType().Name;
    92       }
    93     }
     94        problemInitializationTextBox.Text = OffspringSelectionGP.ProblemInjector.Name;
     95      }
     96    }
     97
     98    private void functionLibraryInjectorViewButton_Click(object sender, EventArgs e) {
     99      IView view = OffspringSelectionGP.FunctionLibraryInjector.CreateView();
     100      if (view != null)
     101        ControlManager.Manager.ShowControl(view);
     102    }
     103
     104    private void functionLibraryInjectorSetButton_Click(object sender, EventArgs e) {
     105      if (chooseOperatorDialog == null) chooseOperatorDialog = new ChooseOperatorDialog();
     106      if (chooseOperatorDialog.ShowDialog(this) == DialogResult.OK) {
     107        OffspringSelectionGP.FunctionLibraryInjector = chooseOperatorDialog.Operator;
     108        functionLibraryInjectorTextBox.Text = OffspringSelectionGP.FunctionLibraryInjector.Name;
     109      }
     110    }
     111
    94112    private void executeButton_Click(object sender, EventArgs e) {
    95113      executeButton.Enabled = false;
     
    120138    }
    121139    private void Engine_Finished(object sender, EventArgs e) {
    122       if(InvokeRequired)
     140      if (InvokeRequired)
    123141        Invoke((EventHandler)Engine_Finished, sender, e);
    124142      else {
     
    135153      randomSeedLabel.Enabled = !setRandomSeedRandomlyCheckBox.Checked;
    136154    }
     155
     156    private void randomSeedTextBox_TextChanged(object sender, EventArgs e) {
     157      int randomSeed;
     158      if (int.TryParse(randomSeedTextBox.Text, out randomSeed)) {
     159        //OffspringSelectionGP.RandomSeed = randomSeed;
     160        errorProvider.SetError(randomSeedTextBox, string.Empty);
     161      } else {
     162        errorProvider.SetError(randomSeedTextBox, "Invalid value.");
     163      }
     164    }
     165
     166    private void populationSizeTextBox_TextChanged(object sender, EventArgs e) {
     167      int popSize;
     168      if (int.TryParse(populationSizeTextBox.Text, out popSize) && popSize > 1) {
     169        //OffspringSelectionGP.PopulationSize = popSize;
     170        errorProvider.SetError(populationSizeTextBox, string.Empty);
     171      } else {
     172        errorProvider.SetError(populationSizeTextBox, "Population size must be a positive integer > 0.");
     173      }
     174    }
     175
     176    private void elitesTextBox_TextChanged(object sender, EventArgs e) {
     177      int elites;
     178      if (int.TryParse(elitesTextBox.Text, out elites) && elites >= 0 && elites < OffspringSelectionGP.PopulationSize) {
     179        //OffspringSelectionGP.Elites = elites;
     180        errorProvider.SetError(elitesTextBox, string.Empty);
     181      } else {
     182        errorProvider.SetError(elitesTextBox, "Invalid value for number of elites. Allowed range [0.." + OffspringSelectionGP.PopulationSize + "[.");
     183      }
     184    }
     185
     186    private void mutationRateTextBox_TextChanged(object sender, EventArgs e) {
     187      double mutationRate;
     188      if (double.TryParse(mutationRateTextBox.Text, out mutationRate) && mutationRate >= 0.0 && mutationRate <= 1.0) {
     189        //OffspringSelectionGP.MutationRate = mutationRate;
     190        errorProvider.SetError(mutationRateTextBox, string.Empty);
     191      } else {
     192        errorProvider.SetError(mutationRateTextBox, "Invalid value for mutation rate. Allowed range = [0..1].");
     193      }
     194    }
     195
     196    private void comparisonFactorTextBox_TextChanged(object sender, EventArgs e) {
     197      double comparisonFactor;
     198      if (double.TryParse(comparisonFactorTextBox.Text, out comparisonFactor) && comparisonFactor >= 0.0 && comparisonFactor <= 1.0) {
     199        //OffspringSelectionGP.ComparisonFactor = comparisonFactor;
     200        errorProvider.SetError(comparisonFactorTextBox, string.Empty);
     201      } else {
     202        errorProvider.SetError(comparisonFactorTextBox, "Invalid value for comparison factor. Allowed range = [0..1].");
     203      }
     204    }
     205
     206    private void successRatioLimitTextBox_TextChanged(object sender, EventArgs e) {
     207      double successRatioLimit;
     208      if (double.TryParse(successRatioLimitTextBox.Text, out successRatioLimit) && successRatioLimit >= 0.0 && successRatioLimit <= 1.0) {
     209        //OffspringSelectionGP.SuccessRatioLimit = successRatioLimit;
     210        errorProvider.SetError(successRatioLimitTextBox, string.Empty);
     211      } else {
     212        errorProvider.SetError(successRatioLimitTextBox, "Invalid value for success ratio limit. Allowed range = [0..1].");
     213      }
     214    }
     215
     216    private void maximumEvaluatedSolutionsTextBox_TextChanged(object sender, EventArgs e) {
     217      int maxEvaluatedSolutions;
     218      if (int.TryParse(maximumEvaluatedSolutionsTextBox.Text, out maxEvaluatedSolutions) && maxEvaluatedSolutions > 0) {
     219        //OffspringSelectionGP.MaxEvaluatedSolutions = maxEvaluatedSolutions;
     220        errorProvider.SetError(maximumEvaluatedSolutionsTextBox, string.Empty);
     221      } else {
     222        errorProvider.SetError(maximumEvaluatedSolutionsTextBox, "Max. evaluated solutions must be a positive integer > 0.");
     223      }
     224    }
     225
     226    private void selectionPressureTextBox_TextChanged(object sender, EventArgs e) {
     227      double maxSelPres;
     228      if (double.TryParse(selectionPressureTextBox.Text, out maxSelPres) && maxSelPres > 1.0) {
     229        //OffspringSelectionGP.SelectionPressureLimit = maxSelPres;
     230        errorProvider.SetError(selectionPressureTextBox, string.Empty);
     231      } else {
     232        errorProvider.SetError(selectionPressureTextBox, "Selection pressure limit must be > 1.0.");
     233      }
     234    }
    137235  }
    138236}
  • trunk/sources/HeuristicLab.GP.Algorithms/3.2/OffSpringSelectionGpEditor.resx

    r2341 r2728  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
Note: See TracChangeset for help on using the changeset viewer.