Changeset 17896 for branches/3073_IA_constraint_splitting_reintegration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/ShapeConstraintsView.cs
- Timestamp:
- 03/16/21 11:08:18 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3073_IA_constraint_splitting_reintegration/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/ShapeConstraintsView.cs
r17894 r17896 2 2 3 3 /* HeuristicLab 4 * Copyright (C) 2002-2019Heuristic and Evolutionary Algorithms Laboratory (HEAL)4 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 5 5 * 6 6 * This file is part of HeuristicLab. … … 48 48 protected override void OnContentChanged() { 49 49 base.OnContentChanged(); 50 this. intervalConstraintsView.Content = Content;50 this.shapeConstraintsView.Content = Content; 51 51 UpdateControl(); 52 52 } … … 86 86 try { 87 87 var parsedConstraints = ShapeConstraintsParser.ParseConstraints(constraintsInput.Text); 88 Content = parsedConstraints;88 Content.AddRange(parsedConstraints); 89 89 errorOutput.Text = "Constraints successfully parsed."; 90 90 errorOutput.ForeColor = Color.DarkGreen; 91 //Catch the exception from the constraints parser and show it in the error dialog92 91 } catch (ArgumentException ex) { 93 Content.Clear();94 92 errorOutput.Text = ex.Message.Replace("Parameter name", "@Line"); 95 93 errorOutput.ForeColor = Color.DarkRed; 94 } finally { 95 suspendUpdates = false; 96 96 } 97 suspendUpdates = false;98 UpdateControl();99 97 } else { 100 98 errorOutput.Text = "No constraints were found!"; … … 107 105 constraintsInput.Text = string.Empty; 108 106 } else { 109 this.intervalConstraintsView.Content = Content; 110 constraintsInput.Text = ToString(Content); 107 var newText = ToString(Content); 108 if (newText != constraintsInput.Text) 109 constraintsInput.Text = newText; 111 110 } 112 111 } … … 168 167 } 169 168 170 private void label1_DoubleClick(object sender, EventArgs e) { 171 var infoText = 172 "Within the text field you can define different types of shape constraints e.g. range constraints, monotonicity constraints, ..." + 173 System.Environment.NewLine + 174 "To define a model constraint: f in [0 .. 100], f is used for the selected target, the 'in' key word specifies the target in which the constraint should be, the interval is defined between square bracket." + 175 System.Environment.NewLine + 176 "The interval contains two bounds (lower and upper) this bounds are given as double values, to seperate both bounds from each other you can use (.., ;, ' ')" + 177 System.Environment.NewLine + 178 "To define monotonic or concave constraints you need to define the partial derivatives:" + 179 System.Environment.NewLine + 180 "∂f/∂x in [0 .. 1], therefore you have to define the partial fraction first, which can be done by using the \\partial symbol or 'd' followed by the target and the variable in the numerator and denominator respectively, after defining the fraction the interval is defined like in the model constraint." + 181 System.Environment.NewLine + 182 "To define constraints only on a specific range of the function you can define interval ranges" + 183 System.Environment.NewLine + 184 "f in [0 .. 100], x in [0 .. 1] the ranges are separated by commas and follow the same rules as before (giving the variable with the interval definition)" + 185 System.Environment.NewLine + "To specify different weights on the constraints:" + 186 System.Environment.NewLine + "f in [0 .. 100], x in [0 .. 1] weight: 2.0, you can add the keyword 'weight:' followed by a double value."; 187 188 MessageBox.Show(infoText,"How to define shape constraints", MessageBoxButtons.OKCancel); 169 private void helpButton_DoubleClick(object sender, EventArgs e) { 170 using (InfoBox dialog = new InfoBox("Help for shape constraints", 171 "HeuristicLab.Problems.DataAnalysis.Views.Resources.shapeConstraintsHelp.rtf", 172 this)) { 173 dialog.ShowDialog(this); 174 } 189 175 } 190 176 }
Note: See TracChangeset
for help on using the changeset viewer.