Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/21 18:13:55 (3 years ago)
Author:
dpiringe
Message:

#3026

  • merged trunk into branch
Location:
branches/3026_IntegrationIntoSymSpace
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace

  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views

  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/FactorPartialDependencePlot.cs

    r17180 r18027  
    222222        if (updateOnFinish)
    223223          Update();
    224       } catch (OperationCanceledException) { 
     224      } catch (OperationCanceledException) {
    225225      } catch (AggregateException ae) {
    226226        if (!ae.InnerExceptions.Any(e => e is OperationCanceledException))
     
    434434      var refSolution = solutions.First();
    435435      var refSolVars = refSolution.ProblemData.Dataset.VariableNames;
     436      var refFactorVars = refSolution.ProblemData.Dataset.StringVariables;
     437      var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray());
     438
    436439      foreach (var solution in solutions.Skip(1)) {
    437         var variables1 = solution.ProblemData.Dataset.VariableNames;
    438         if (!variables1.All(refSolVars.Contains))
     440        var variables1 = new HashSet<string>(solution.ProblemData.Dataset.VariableNames);
     441        if (!variables1.IsSubsetOf(refSolVars))
    439442          return false;
    440443
    441         foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) {
    442           var distinctVals = refSolution.ProblemData.Dataset.GetStringValues(factorVar).Distinct();
    443           if (solution.ProblemData.Dataset.GetStringValues(factorVar).Any(val => !distinctVals.Contains(val))) return false;
     444        foreach (var factorVar in solution.ProblemData.Dataset.StringVariables) {
     445          var refValues = distinctVals[factorVar];
     446          var values = new HashSet<string>(solution.ProblemData.Dataset.GetStringValues(factorVar));
     447
     448          if (!values.IsSubsetOf(refValues))
     449            return false;
    444450        }
    445451      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Controls/PartialDependencePlot.cs

    r17928 r18027  
    568568      var refSolution = solutions.First();
    569569      var refSolVars = refSolution.ProblemData.Dataset.VariableNames;
    570       var refFactorVars = refSolVars.Where(refSolution.ProblemData.Dataset.VariableHasType<string>);
     570      var refFactorVars = refSolution.ProblemData.Dataset.StringVariables;
    571571      var distinctVals = refFactorVars.ToDictionary(fv => fv, fv => refSolution.ProblemData.Dataset.GetStringValues(fv).Distinct().ToArray());
     572
    572573      foreach (var solution in solutions.Skip(1)) {
    573         var variables1 = solution.ProblemData.Dataset.VariableNames;
    574         if (!variables1.All(refSolVars.Contains))
     574        var variables1 = new HashSet<string>(solution.ProblemData.Dataset.VariableNames);
     575        if (!variables1.IsSubsetOf(refSolVars))
    575576          return false;
    576577
    577         foreach (var factorVar in variables1.Where(solution.ProblemData.Dataset.VariableHasType<string>)) {
     578        foreach (var factorVar in solution.ProblemData.Dataset.StringVariables) {
    578579          var refValues = distinctVals[factorVar];
    579           if (solution.ProblemData.Dataset.GetStringValues(factorVar).Distinct().Any(val => !refValues.Contains(val))) return false;
     580          var values = new HashSet<string>(solution.ProblemData.Dataset.GetStringValues(factorVar));
     581
     582          if (!values.IsSubsetOf(refValues))
     583            return false;
    580584        }
    581585      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r17928 r18027  
    9999  </PropertyGroup>
    100100  <ItemGroup>
    101     <Reference Include="ALGLIB-3.7.0, Version=3.7.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    102       <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath>
     101    <Reference Include="ALGLIB-3.17.0, Version=3.17.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     102      <SpecificVersion>False</SpecificVersion>
     103      <HintPath>..\..\bin\ALGLIB-3.17.0.dll</HintPath>
    103104      <Private>False</Private>
    104105    </Reference>
     
    582583      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    583584      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    584       <Private>False</Private>
    585     </ProjectReference>
    586     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj">
    587       <Project>{5AC82412-911B-4FA2-A013-EDC5E3F3FCC2}</Project>
    588       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4</Name>
    589       <Private>False</Private>
    590     </ProjectReference>
    591     <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
    592       <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
    593       <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
    594585      <Private>False</Private>
    595586    </ProjectReference>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Plugin.cs.frame

    r17184 r18027  
    2828  [Plugin("HeuristicLab.Problems.DataAnalysis.Views", "Provides views for base classes for data analysis tasks.", "3.4.12.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Views-3.4.dll", PluginFileType.Assembly)]
    30   [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
     30  [PluginDependency("HeuristicLab.ALGLIB", "3.17.0")]
    3131  [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")]
    3232  [PluginDependency("HeuristicLab.Analysis", "3.3")]
     
    4545  [PluginDependency("HeuristicLab.Optimizer", "3.3")]
    4646  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    47   [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression", "3.4")]
    4847  [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")]
    4948  public class HeuristicLabProblemsDataAnalysisViewsPlugin : PluginBase {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r17180 r18027  
    2929using HeuristicLab.MainForm;
    3030using HeuristicLab.Optimization;
     31using HeuristicLab.PluginInfrastructure;
    3132
    3233namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    7475    }
    7576
    76     private readonly IList<IRegressionSolution> solutions = new List<IRegressionSolution>();
     77    private readonly List<IRegressionSolution> solutions = new List<IRegressionSolution>();
    7778    public IEnumerable<IRegressionSolution> Solutions {
    7879      get { return solutions.AsEnumerable(); }
     
    101102      else {
    102103        // recalculate baseline solutions (for symbolic regression models the features used in the model might have changed)
    103         solutions.Clear(); // remove all
     104        solutions.Clear();
    104105        solutions.Add(Content); // re-add the first solution
    105         // and recalculate all other solutions
    106         foreach (var sol in CreateBaselineSolutions()) {
    107           solutions.Add(sol);
    108         }
     106        solutions.AddRange(CreateBaselineSolutions());
    109107        UpdateChart();
    110108      }
     
    114112      else {
    115113        // recalculate baseline solutions
    116         solutions.Clear(); // remove all
     114        solutions.Clear();
    117115        solutions.Add(Content); // re-add the first solution
    118         // and recalculate all other solutions
    119         foreach (var sol in CreateBaselineSolutions()) {
    120           solutions.Add(sol);
    121         }
     116        solutions.AddRange(CreateBaselineSolutions());
    122117        UpdateChart();
    123118      }
     
    129124      ReadOnly = Content == null;
    130125      if (Content != null) {
    131         // recalculate all solutions
    132126        solutions.Add(Content);
    133         if (ProblemData.TrainingIndices.Any()) {
    134           foreach (var sol in CreateBaselineSolutions())
    135             solutions.Add(sol);
    136           // more solutions can be added by drag&drop
    137         }
     127        solutions.AddRange(CreateBaselineSolutions());
    138128      }
    139129      UpdateChart();
     
    175165      UpdateSeries(residuals, solutionSeries);
    176166
    177       solutionSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(solutionSeries);
     167      solutionSeries.ToolTip = "Area over curve: " + CalculateAreaOverCurve(solutionSeries);
    178168      solutionSeries.LegendToolTip = "Double-click to open model";
    179169      chart.Series.Add(solutionSeries);
     
    249239    protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) {
    250240      switch (residualComboBox.SelectedItem.ToString()) {
    251         case "Absolute error": return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y))
     241        case "Absolute error":
     242          return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y))
    252243            .Where(r => !double.IsNaN(r) && !double.IsInfinity(r)).ToList();
    253         case "Squared error": return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y))
     244        case "Squared error":
     245          return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y))
    254246            .Where(r => !double.IsNaN(r) && !double.IsInfinity(r)).ToList();
    255247        case "Relative error":
     
    289281
    290282    protected virtual IEnumerable<IRegressionSolution> CreateBaselineSolutions() {
    291       yield return CreateConstantSolution();
    292       yield return CreateLinearSolution();
     283      var constantSolution = CreateConstantSolution();
     284      if (constantSolution != null) yield return constantSolution;
     285
     286      var linearRegressionSolution = CreateLinearSolution();
     287      if (linearRegressionSolution != null) yield return linearRegressionSolution;
    293288    }
    294289
    295290    private IRegressionSolution CreateConstantSolution() {
     291      if (!ProblemData.TrainingIndices.Any()) return null;
     292
    296293      double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average();
    297294      var model = new ConstantModel(averageTrainingTarget, ProblemData.TargetVariable);
     
    301298    }
    302299    private IRegressionSolution CreateLinearSolution() {
    303       double rmsError, cvRmsError;
    304       var solution = LinearRegression.CreateLinearRegressionSolution((IRegressionProblemData)ProblemData.Clone(), out rmsError, out cvRmsError);
    305       solution.Name = "Baseline (linear)";
    306       return solution;
     300      try {
     301        var solution = LinearRegression.CreateSolution((IRegressionProblemData)ProblemData.Clone(), out _, out _);
     302        solution.Name = "Baseline (linear)";
     303        return solution;
     304      } catch (NotSupportedException e) {
     305        ErrorHandling.ShowErrorDialog("Could not create a linear regression solution.", e);
     306      } catch (ArgumentException e) {
     307        ErrorHandling.ShowErrorDialog("Could not create a linear regression solution.", e);
     308      }
     309      return null;
    307310    }
    308311
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionPartialDependencePlotView.cs

    r17180 r18027  
    119119
    120120      // create dataset of problemData input variables and model input variables
    121       // necessary workaround to have the variables in the occuring order
     121      // necessary workaround to have the variables in the occurring order
    122122      var inputvariables =
    123123        new HashSet<string>(Content.ProblemData.AllowedInputVariables.Union(Content.Model.VariablesUsedForPrediction));
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/ShapeConstraintView.Designer.cs

    r17928 r18027  
    4747    /// </summary>
    4848    private void InitializeComponent() {
    49       this.components = new System.ComponentModel.Container();
    50       this.lowerboundLabel = new System.Windows.Forms.Label();
    51       this.upperboundLabel = new System.Windows.Forms.Label();
    52       this.variableLabel = new System.Windows.Forms.Label();
    53       this.numberOfDerivationLabel = new System.Windows.Forms.Label();
    54       this.upperboundInput = new System.Windows.Forms.TextBox();
    55       this.lowerboundInput = new System.Windows.Forms.TextBox();
    56       this.variableInput = new System.Windows.Forms.TextBox();
    57       this.groupBox = new System.Windows.Forms.GroupBox();
    58       this.weightTextBox = new System.Windows.Forms.TextBox();
    59       this.weightLabel = new System.Windows.Forms.Label();
    60       this.regionLabel = new System.Windows.Forms.Label();
    61       this.regionView = new HeuristicLab.Problems.DataAnalysis.Views.IntervalCollectionView();
    62       this.numberOfDerivationsComboBox = new System.Windows.Forms.ComboBox();
    63       this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
    64       this.groupBox.SuspendLayout();
    65       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    66       this.SuspendLayout();
    67       //
    68       // lowerboundLabel
    69       //
    70       this.lowerboundLabel.AutoSize = true;
    71       this.lowerboundLabel.Location = new System.Drawing.Point(8, 75);
    72       this.lowerboundLabel.Name = "lowerboundLabel";
    73       this.lowerboundLabel.Size = new System.Drawing.Size(72, 13);
    74       this.lowerboundLabel.TabIndex = 4;
    75       this.lowerboundLabel.Text = "Lower bound:";
    76       //
    77       // upperboundLabel
    78       //
    79       this.upperboundLabel.AutoSize = true;
    80       this.upperboundLabel.Location = new System.Drawing.Point(8, 101);
    81       this.upperboundLabel.Name = "upperboundLabel";
    82       this.upperboundLabel.Size = new System.Drawing.Size(72, 13);
    83       this.upperboundLabel.TabIndex = 6;
    84       this.upperboundLabel.Text = "Upper bound:";
    85       //
    86       // variableLabel
    87       //
    88       this.variableLabel.AutoSize = true;
    89       this.variableLabel.Location = new System.Drawing.Point(8, 22);
    90       this.variableLabel.Name = "variableLabel";
    91       this.variableLabel.Size = new System.Drawing.Size(48, 13);
    92       this.variableLabel.TabIndex = 0;
    93       this.variableLabel.Text = "Variable:";
    94       //
    95       // numberderivationLabel
    96       //
    97       this.numberOfDerivationLabel.AutoSize = true;
    98       this.numberOfDerivationLabel.Location = new System.Drawing.Point(8, 48);
    99       this.numberOfDerivationLabel.Name = "numberderivationLabel";
    100       this.numberOfDerivationLabel.Size = new System.Drawing.Size(58, 13);
    101       this.numberOfDerivationLabel.TabIndex = 2;
    102       this.numberOfDerivationLabel.Text = "Derivative:";
    103       //
    104       // upperboundInput
    105       //
    106       this.upperboundInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    107             | System.Windows.Forms.AnchorStyles.Right)));
    108       this.upperboundInput.Location = new System.Drawing.Point(86, 98);
    109       this.upperboundInput.Name = "upperboundInput";
    110       this.upperboundInput.Size = new System.Drawing.Size(495, 20);
    111       this.upperboundInput.TabIndex = 7;
    112       this.upperboundInput.Validating += new System.ComponentModel.CancelEventHandler(this.upperboundInput_Validating);
    113       this.upperboundInput.Validated += new System.EventHandler(this.upperboundInput_Validated);
    114       //
    115       // lowerboundInput
    116       //
    117       this.lowerboundInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    118             | System.Windows.Forms.AnchorStyles.Right)));
    119       this.lowerboundInput.Location = new System.Drawing.Point(86, 72);
    120       this.lowerboundInput.Name = "lowerboundInput";
    121       this.lowerboundInput.Size = new System.Drawing.Size(495, 20);
    122       this.lowerboundInput.TabIndex = 5;
    123       this.lowerboundInput.Validating += new System.ComponentModel.CancelEventHandler(this.lowerboundInput_Validating);
    124       this.lowerboundInput.Validated += new System.EventHandler(this.lowerboundInput_Validated);
    125       //
    126       // variableInput
    127       //
    128       this.variableInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    129             | System.Windows.Forms.AnchorStyles.Right)));
    130       this.variableInput.Location = new System.Drawing.Point(86, 19);
    131       this.variableInput.Name = "variableInput";
    132       this.variableInput.Size = new System.Drawing.Size(495, 20);
    133       this.variableInput.TabIndex = 1;
    134       //
    135       // groupBox
    136       //
    137       this.groupBox.Controls.Add(this.weightTextBox);
    138       this.groupBox.Controls.Add(this.weightLabel);
    139       this.groupBox.Controls.Add(this.regionLabel);
    140       this.groupBox.Controls.Add(this.regionView);
    141       this.groupBox.Controls.Add(this.numberOfDerivationsComboBox);
    142       this.groupBox.Controls.Add(this.variableInput);
    143       this.groupBox.Controls.Add(this.lowerboundInput);
    144       this.groupBox.Controls.Add(this.upperboundInput);
    145       this.groupBox.Controls.Add(this.numberOfDerivationLabel);
    146       this.groupBox.Controls.Add(this.variableLabel);
    147       this.groupBox.Controls.Add(this.upperboundLabel);
    148       this.groupBox.Controls.Add(this.lowerboundLabel);
    149       this.groupBox.Dock = System.Windows.Forms.DockStyle.Fill;
    150       this.groupBox.Location = new System.Drawing.Point(0, 0);
    151       this.groupBox.Name = "groupBox";
    152       this.groupBox.Size = new System.Drawing.Size(587, 380);
    153       this.groupBox.TabIndex = 0;
    154       this.groupBox.TabStop = false;
    155       this.groupBox.Text = "Shape Constraint Detail";
    156       //
    157       // weightInput
    158       //
    159       this.weightTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    160             | System.Windows.Forms.AnchorStyles.Right)));
    161       this.weightTextBox.Location = new System.Drawing.Point(86, 124);
    162       this.weightTextBox.Name = "weightInput";
    163       this.weightTextBox.Size = new System.Drawing.Size(495, 20);
    164       this.weightTextBox.TabIndex = 9;
    165       this.weightTextBox.TextChanged += new System.EventHandler(this.weightInput_TextChanged);
    166       //
    167       // WeightLab
    168       //
    169       this.weightLabel.AutoSize = true;
    170       this.weightLabel.Location = new System.Drawing.Point(8, 127);
    171       this.weightLabel.Name = "WeightLab";
    172       this.weightLabel.Size = new System.Drawing.Size(44, 13);
    173       this.weightLabel.TabIndex = 8;
    174       this.weightLabel.Text = "Weight:";
    175       //
    176       // regionLab
    177       //
    178       this.regionLabel.AutoSize = true;
    179       this.regionLabel.Location = new System.Drawing.Point(8, 150);
    180       this.regionLabel.Name = "regionLab";
    181       this.regionLabel.Size = new System.Drawing.Size(49, 13);
    182       this.regionLabel.TabIndex = 10;
    183       this.regionLabel.Text = "Regions:";
    184       //
    185       // regionView
    186       //
    187       this.regionView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    188             | System.Windows.Forms.AnchorStyles.Left)
    189             | System.Windows.Forms.AnchorStyles.Right)));
    190       this.regionView.Caption = "IntervalCollection View";
    191       this.regionView.Content = null;
    192       this.regionView.Location = new System.Drawing.Point(86, 150);
    193       this.regionView.Name = "regionView";
    194       this.regionView.ReadOnly = false;
    195       this.regionView.Size = new System.Drawing.Size(495, 224);
    196       this.regionView.TabIndex = 11;
    197       this.regionView.TabStop = false;
    198       //
    199       // numberderivationInput
    200       //
    201       this.numberOfDerivationsComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    202             | System.Windows.Forms.AnchorStyles.Right)));
    203       this.numberOfDerivationsComboBox.FormattingEnabled = true;
    204       this.numberOfDerivationsComboBox.Location = new System.Drawing.Point(86, 45);
    205       this.numberOfDerivationsComboBox.Name = "numberderivationInput";
    206       this.numberOfDerivationsComboBox.Size = new System.Drawing.Size(495, 21);
    207       this.numberOfDerivationsComboBox.TabIndex = 3;
    208       this.numberOfDerivationsComboBox.SelectedIndexChanged += new System.EventHandler(this.numberderivationInput_SelectedIndexChanged);
    209       //
    210       // errorProvider
    211       //
    212       this.errorProvider.ContainerControl = this;
    213       this.errorProvider.RightToLeft = true;
    214       //
    215       // ShapeConstraintView
    216       //
    217       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    218       this.Controls.Add(this.groupBox);
    219       this.Name = "ShapeConstraintView";
    220       this.Size = new System.Drawing.Size(587, 380);
    221       this.groupBox.ResumeLayout(false);
    222       this.groupBox.PerformLayout();
    223       ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    224       this.ResumeLayout(false);
     49            this.components = new System.ComponentModel.Container();
     50            this.errorProvider = new System.Windows.Forms.ErrorProvider(this.components);
     51            this.lowerboundLabel = new System.Windows.Forms.Label();
     52            this.upperboundLabel = new System.Windows.Forms.Label();
     53            this.variableLabel = new System.Windows.Forms.Label();
     54            this.numberOfDerivationLabel = new System.Windows.Forms.Label();
     55            this.upperboundInput = new System.Windows.Forms.TextBox();
     56            this.lowerboundInput = new System.Windows.Forms.TextBox();
     57            this.variableInput = new System.Windows.Forms.TextBox();
     58            this.numberOfDerivationsComboBox = new System.Windows.Forms.ComboBox();
     59            this.regionLabel = new System.Windows.Forms.Label();
     60            this.weightLabel = new System.Windows.Forms.Label();
     61            this.weightTextBox = new System.Windows.Forms.TextBox();
     62            this.regionView = new HeuristicLab.Problems.DataAnalysis.Views.IntervalCollectionView();
     63            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     64            this.SuspendLayout();
     65            //
     66            // errorProvider
     67            //
     68            this.errorProvider.ContainerControl = this;
     69            this.errorProvider.RightToLeft = true;
     70            //
     71            // lowerboundLabel
     72            //
     73            this.lowerboundLabel.AutoSize = true;
     74            this.lowerboundLabel.Location = new System.Drawing.Point(2, 59);
     75            this.lowerboundLabel.Name = "lowerboundLabel";
     76            this.lowerboundLabel.Size = new System.Drawing.Size(72, 13);
     77            this.lowerboundLabel.TabIndex = 4;
     78            this.lowerboundLabel.Text = "Lower bound:";
     79            //
     80            // upperboundLabel
     81            //
     82            this.upperboundLabel.AutoSize = true;
     83            this.upperboundLabel.Location = new System.Drawing.Point(2, 85);
     84            this.upperboundLabel.Name = "upperboundLabel";
     85            this.upperboundLabel.Size = new System.Drawing.Size(72, 13);
     86            this.upperboundLabel.TabIndex = 6;
     87            this.upperboundLabel.Text = "Upper bound:";
     88            //
     89            // variableLabel
     90            //
     91            this.variableLabel.AutoSize = true;
     92            this.variableLabel.Location = new System.Drawing.Point(2, 6);
     93            this.variableLabel.Name = "variableLabel";
     94            this.variableLabel.Size = new System.Drawing.Size(48, 13);
     95            this.variableLabel.TabIndex = 0;
     96            this.variableLabel.Text = "Variable:";
     97            //
     98            // numberOfDerivationLabel
     99            //
     100            this.numberOfDerivationLabel.AutoSize = true;
     101            this.numberOfDerivationLabel.Location = new System.Drawing.Point(2, 32);
     102            this.numberOfDerivationLabel.Name = "numberOfDerivationLabel";
     103            this.numberOfDerivationLabel.Size = new System.Drawing.Size(58, 13);
     104            this.numberOfDerivationLabel.TabIndex = 2;
     105            this.numberOfDerivationLabel.Text = "Derivative:";
     106            //
     107            // upperboundInput
     108            //
     109            this.upperboundInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     110            | System.Windows.Forms.AnchorStyles.Right)));
     111            this.upperboundInput.Location = new System.Drawing.Point(80, 82);
     112            this.upperboundInput.Name = "upperboundInput";
     113            this.upperboundInput.Size = new System.Drawing.Size(495, 20);
     114            this.upperboundInput.TabIndex = 7;
     115            this.upperboundInput.Validating += new System.ComponentModel.CancelEventHandler(this.upperboundInput_Validating);
     116            this.upperboundInput.Validated += new System.EventHandler(this.upperboundInput_Validated);
     117            //
     118            // lowerboundInput
     119            //
     120            this.lowerboundInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     121            | System.Windows.Forms.AnchorStyles.Right)));
     122            this.lowerboundInput.Location = new System.Drawing.Point(80, 56);
     123            this.lowerboundInput.Name = "lowerboundInput";
     124            this.lowerboundInput.Size = new System.Drawing.Size(495, 20);
     125            this.lowerboundInput.TabIndex = 5;
     126            this.lowerboundInput.Validating += new System.ComponentModel.CancelEventHandler(this.lowerboundInput_Validating);
     127            this.lowerboundInput.Validated += new System.EventHandler(this.lowerboundInput_Validated);
     128            //
     129            // variableInput
     130            //
     131            this.variableInput.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     132            | System.Windows.Forms.AnchorStyles.Right)));
     133            this.variableInput.Location = new System.Drawing.Point(80, 3);
     134            this.variableInput.Name = "variableInput";
     135            this.variableInput.Size = new System.Drawing.Size(495, 20);
     136            this.variableInput.TabIndex = 1;
     137            this.variableInput.TextChanged += new System.EventHandler(this.variableInput_TextChanged);
     138            //
     139            // numberOfDerivationsComboBox
     140            //
     141            this.numberOfDerivationsComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     142            | System.Windows.Forms.AnchorStyles.Right)));
     143            this.numberOfDerivationsComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     144            this.numberOfDerivationsComboBox.FormattingEnabled = true;
     145            this.numberOfDerivationsComboBox.Items.AddRange(new object[] {
     146            "1",
     147            "2",
     148            "3"});
     149            this.numberOfDerivationsComboBox.Location = new System.Drawing.Point(80, 29);
     150            this.numberOfDerivationsComboBox.Name = "numberOfDerivationsComboBox";
     151            this.numberOfDerivationsComboBox.Size = new System.Drawing.Size(495, 21);
     152            this.numberOfDerivationsComboBox.TabIndex = 3;
     153            this.numberOfDerivationsComboBox.SelectedIndexChanged += new System.EventHandler(this.numberderivationInput_SelectedIndexChanged);
     154            //
     155            // regionLabel
     156            //
     157            this.regionLabel.AutoSize = true;
     158            this.regionLabel.Location = new System.Drawing.Point(2, 134);
     159            this.regionLabel.Name = "regionLabel";
     160            this.regionLabel.Size = new System.Drawing.Size(49, 13);
     161            this.regionLabel.TabIndex = 10;
     162            this.regionLabel.Text = "Regions:";
     163            //
     164            // weightLabel
     165            //
     166            this.weightLabel.AutoSize = true;
     167            this.weightLabel.Location = new System.Drawing.Point(2, 111);
     168            this.weightLabel.Name = "weightLabel";
     169            this.weightLabel.Size = new System.Drawing.Size(44, 13);
     170            this.weightLabel.TabIndex = 8;
     171            this.weightLabel.Text = "Weight:";
     172            //
     173            // weightTextBox
     174            //
     175            this.weightTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     176            | System.Windows.Forms.AnchorStyles.Right)));
     177            this.weightTextBox.Location = new System.Drawing.Point(80, 108);
     178            this.weightTextBox.Name = "weightTextBox";
     179            this.weightTextBox.Size = new System.Drawing.Size(495, 20);
     180            this.weightTextBox.TabIndex = 9;
     181            this.weightTextBox.TextChanged += new System.EventHandler(this.weightInput_TextChanged);
     182            //
     183            // regionView
     184            //
     185            this.regionView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     186            | System.Windows.Forms.AnchorStyles.Right)));
     187            this.regionView.AutoSize = true;
     188            this.regionView.Caption = "IntervalCollection View";
     189            this.regionView.Content = null;
     190            this.regionView.Location = new System.Drawing.Point(80, 134);
     191            this.regionView.Name = "regionView";
     192            this.regionView.ReadOnly = false;
     193            this.regionView.Size = new System.Drawing.Size(495, 243);
     194            this.regionView.TabIndex = 11;
     195            this.regionView.TabStop = false;
     196            //
     197            // ShapeConstraintView
     198            //
     199            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     200            this.Controls.Add(this.weightTextBox);
     201            this.Controls.Add(this.weightLabel);
     202            this.Controls.Add(this.variableInput);
     203            this.Controls.Add(this.regionLabel);
     204            this.Controls.Add(this.lowerboundLabel);
     205            this.Controls.Add(this.regionView);
     206            this.Controls.Add(this.upperboundLabel);
     207            this.Controls.Add(this.numberOfDerivationsComboBox);
     208            this.Controls.Add(this.variableLabel);
     209            this.Controls.Add(this.numberOfDerivationLabel);
     210            this.Controls.Add(this.lowerboundInput);
     211            this.Controls.Add(this.upperboundInput);
     212            this.Name = "ShapeConstraintView";
     213            this.Size = new System.Drawing.Size(587, 380);
     214            ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     215            this.ResumeLayout(false);
     216            this.PerformLayout();
    225217
    226218    }
    227219
    228220    #endregion
    229 
     221    private System.Windows.Forms.ErrorProvider errorProvider;
     222    private System.Windows.Forms.TextBox weightTextBox;
     223    private System.Windows.Forms.Label weightLabel;
     224    private System.Windows.Forms.TextBox variableInput;
     225    private System.Windows.Forms.Label regionLabel;
    230226    private System.Windows.Forms.Label lowerboundLabel;
     227    private IntervalCollectionView regionView;
    231228    private System.Windows.Forms.Label upperboundLabel;
     229    private System.Windows.Forms.ComboBox numberOfDerivationsComboBox;
    232230    private System.Windows.Forms.Label variableLabel;
    233231    private System.Windows.Forms.Label numberOfDerivationLabel;
     232    private System.Windows.Forms.TextBox lowerboundInput;
    234233    private System.Windows.Forms.TextBox upperboundInput;
    235     private System.Windows.Forms.TextBox lowerboundInput;
    236     private System.Windows.Forms.TextBox variableInput;
    237     private System.Windows.Forms.GroupBox groupBox;
    238     private System.Windows.Forms.ErrorProvider errorProvider;
    239     private System.Windows.Forms.ComboBox numberOfDerivationsComboBox;
    240     private IntervalCollectionView regionView;
    241     private System.Windows.Forms.Label regionLabel;
    242     private System.Windows.Forms.TextBox weightTextBox;
    243     private System.Windows.Forms.Label weightLabel;
    244234  }
    245235}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/ShapeConstraintView.cs

    r17928 r18027  
    6565    protected override void SetEnabledStateOfControls() {
    6666      base.SetEnabledStateOfControls();
    67       variableInput.Enabled = Content != null && !Locked && !ReadOnly;
     67      variableInput.Enabled = Content != null && !Locked && !ReadOnly && Content.Variable != String.Empty;
    6868      numberOfDerivationsComboBox.Enabled = Content != null && !Locked && !ReadOnly;
    6969      lowerboundInput.Enabled = Content != null && !Locked && !ReadOnly;
     
    112112        numberOfDerivationsComboBox.Enabled = false;
    113113        numberOfDerivationsComboBox.SelectedItem = null;
    114         numberOfDerivationsComboBox.Text = "0";
    115114      } else {
    116         numberOfDerivationLabel.Visible = true;
    117         numberOfDerivationsComboBox.Visible = true;
    118115        numberOfDerivationsComboBox.Enabled = true;
    119116        numberOfDerivationsComboBox.SelectedItem = Content.NumberOfDerivations;
    120117      }
    121118
    122       regionView.Content = Content.Regions;
     119      if (Content.Regions.Count > 0) {
     120        regionView.Content = Content.Regions;
     121        regionLabel.Visible = true;
     122        regionView.Visible = true;
     123      } else {
     124        regionLabel.Visible = false;
     125        regionView.Visible = false;
     126      }
    123127    }
    124128
     
    197201    }
    198202
     203    private void variableInput_TextChanged(object sender, EventArgs e) {
     204      var value = variableInput.Text;
     205      if (!String.IsNullOrEmpty(value)) Content.Variable = value;
     206    }
    199207
    200208    #endregion
     
    206214    }
    207215
    208    #endregion
     216
     217    #endregion
    209218  }
    210219}
Note: See TracChangeset for help on using the changeset viewer.