Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/28/18 11:13:37 (6 years ago)
Author:
gkronber
Message:

#2522: merged trunk changes from r13402:15972 to branch resolving conflicts where necessary

Location:
branches/2522_RefactorPluginInfrastructure
Files:
2 deleted
33 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/2522_RefactorPluginInfrastructure

  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Exporters/SymbolicSolutionExcelExporter.cs

    r12509 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r12817 r15973  
    121121      <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon>
    122122    </Compile>
    123     <Compile Include="MathSymbolicDataAnalysisModelView.cs">
    124       <SubType>UserControl</SubType>
    125     </Compile>
    126     <Compile Include="MathSymbolicDataAnalysisModelView.designer.cs">
    127       <DependentUpon>MathSymbolicDataAnalysisModelView.cs</DependentUpon>
     123    <Compile Include="SymbolicDataAnalysisModelMathView.cs">
     124      <SubType>UserControl</SubType>
     125    </Compile>
     126    <Compile Include="SymbolicDataAnalysisModelMathView.designer.cs">
     127      <DependentUpon>SymbolicDataAnalysisModelMathView.cs</DependentUpon>
    128128    </Compile>
    129129    <Compile Include="Plugin.cs" />
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    187187      this.treeChart.Name = "treeChart";
    188188      this.treeChart.Size = new System.Drawing.Size(201, 348);
    189       this.treeChart.Spacing = 5;
    190189      this.treeChart.SuspendRepaint = false;
    191190      this.treeChart.TabIndex = 0;
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2424using System.Drawing;
    2525using System.Linq;
     26using System.Threading.Tasks;
    2627using System.Windows.Forms;
    2728using HeuristicLab.Common;
    2829using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2930using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
     31using HeuristicLab.MainForm;
    3032using HeuristicLab.MainForm.WindowsForms;
    3133
     
    3638    private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts;
    3739
     40    private readonly ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator;
     41
     42    private readonly IProgress progress = new Progress();
     43
    3844    private enum TreeState { Valid, Invalid }
    3945    private TreeState treeState;
    4046
    41     protected InteractiveSymbolicDataAnalysisSolutionSimplifierView() {
     47    protected InteractiveSymbolicDataAnalysisSolutionSimplifierView(ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator) {
    4248      InitializeComponent();
    4349      foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
     
    4551      nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>();
    4652      this.Caption = "Interactive Solution Simplifier";
     53      this.impactCalculator = impactCalculator;
    4754
    4855      // initialize the tree modifier that will be used to perform edit operations over the tree
     
    112119      treeChart.Tree = tree;
    113120      treeChart.Repaint();
    114       bool valid = !tree.IterateNodesPostfix().Any(node => node.SubtreeCount < GetMinArity(node.Symbol) || node.SubtreeCount > node.Symbol.MaximumArity);
     121      // check if all nodes have a legal arity
     122      var nodes = tree.IterateNodesPostfix().ToList();
     123      bool valid = !nodes.Any(node => node.SubtreeCount < GetMinArity(node.Symbol) || node.SubtreeCount > node.Symbol.MaximumArity);
     124
     125      if (valid) {
     126        // check if all variables are contained in the dataset
     127        var variables = new HashSet<string>(Content.ProblemData.Dataset.DoubleVariables);
     128        valid = nodes.OfType<VariableTreeNode>().All(x => variables.Contains(x.VariableName));
     129      }
     130
    115131      if (valid) {
    116132        btnOptimizeConstants.Enabled = true;
     
    136152      Content.ProblemDataChanged += Content_Changed;
    137153      treeChart.Repainted += treeChart_Repainted;
     154      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(grpSimplify, progress);
    138155    }
    139156    protected override void DeregisterContentEvents() {
     
    142159      Content.ProblemDataChanged -= Content_Changed;
    143160      treeChart.Repainted -= treeChart_Repainted;
     161      MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(grpSimplify, false);
    144162    }
    145163
     
    160178    }
    161179
    162     private void UpdateView() {
     180    private async void UpdateView() {
    163181      if (Content == null || Content.Model == null || Content.ProblemData == null) return;
    164182      var tree = Content.Model.SymbolicExpressionTree;
    165183      treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
    166184
    167       var impactAndReplacementValues = CalculateImpactAndReplacementValues(tree);
     185      progress.Start("Calculate Impact and Replacement Values ...");
     186      var impactAndReplacementValues = await Task.Run(() => CalculateImpactAndReplacementValues(tree));
     187      await Task.Delay(500); // wait for progressbar to finish animation
    168188      var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2);
    169189      foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) {
     
    171191      }
    172192      nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1);
     193      progress.Finish();
    173194      PaintNodeImpacts();
    174195    }
    175196
    176     protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree);
    177     protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree);
    178     protected abstract Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree);
     197    protected virtual Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree) {
     198      var impactAndReplacementValues = new Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>>();
     199      foreach (var node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
     200        double impactValue, replacementValue, newQualityForImpactsCalculation;
     201        impactCalculator.CalculateImpactAndReplacementValues(Content.Model, node, Content.ProblemData, Content.ProblemData.TrainingIndices, out impactValue, out replacementValue, out newQualityForImpactsCalculation);
     202        double newProgressValue = progress.ProgressValue + 1.0 / (tree.Length - 2);
     203        progress.ProgressValue = Math.Min(newProgressValue, 1);
     204        impactAndReplacementValues.Add(node, new Tuple<double, double>(impactValue, replacementValue));
     205      }
     206      return impactAndReplacementValues;
     207    }
     208
    179209    protected abstract void UpdateModel(ISymbolicExpressionTree tree);
     210
     211    protected virtual ISymbolicExpressionTree OptimizeConstants(ISymbolicExpressionTree tree, IProgress progress) {
     212      return tree;
     213    }
    180214
    181215    private static ConstantTreeNode MakeConstantTreeNode(double value) {
     
    259293
    260294    private void btnSimplify_Click(object sender, EventArgs e) {
    261       var simplifier = new SymbolicDataAnalysisExpressionTreeSimplifier();
    262       var simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
     295      var simplifiedExpressionTree = TreeSimplifier.Simplify(Content.Model.SymbolicExpressionTree);
    263296      UpdateModel(simplifiedExpressionTree);
    264297    }
    265298
    266     protected abstract void btnOptimizeConstants_Click(object sender, EventArgs e);
     299    private async void btnOptimizeConstants_Click(object sender, EventArgs e) {
     300      progress.Start("Optimizing Constants ...");
     301      var tree = (ISymbolicExpressionTree)Content.Model.SymbolicExpressionTree.Clone();
     302      var newTree = await Task.Run(() => OptimizeConstants(tree, progress));
     303      await Task.Delay(500); // wait for progressbar to finish animation
     304      UpdateModel(newTree); // UpdateModel calls Progress.Finish (via Content_Changed)
     305    }
    267306  }
    268307}
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicExpressionTreeChart.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    102102        if (dialog.DialogResult != DialogResult.OK) return;
    103103
    104         var symbol = dialog.SelectedSymbol();
     104        var symbol = dialog.SelectedSymbol;
    105105        var node = symbol.CreateTreeNode();
    106106        if (node is ConstantTreeNode) {
     
    110110          var variable = node as VariableTreeNode;
    111111          variable.Weight = double.Parse(dialog.variableWeightTextBox.Text);
    112           variable.VariableName = dialog.variableNamesCombo.Text;
     112          variable.VariableName = dialog.SelectedVariableName;
    113113        } else if (node.Symbol.MinimumArity <= parent.SubtreeCount && node.Symbol.MaximumArity >= parent.SubtreeCount) {
    114114          for (int i = parent.SubtreeCount - 1; i >= 0; --i) {
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame

    r13321 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2626
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    28   [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.9.$WCREV$")]
     28  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.11.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginFile("displayModelFrame.html", PluginFileType.Data)]
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/AssemblyInfo.cs.frame

    r13321 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131[assembly: AssemblyCompany("")]
    3232[assembly: AssemblyProduct("HeuristicLab")]
    33 [assembly: AssemblyCopyright("(c) 2002-2015 HEAL")]
     33[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
    3434[assembly: AssemblyTrademark("")]
    3535[assembly: AssemblyCulture("")]
     
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.4.0.0")]
    55 [assembly: AssemblyFileVersion("3.4.9.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.4.11.$WCREV$")]
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs

    r12817 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    6363      // weightInitializationMuTextBox
    6464      //
     65      this.weightInitializationMuTextBox.Size = new System.Drawing.Size(293, 20);
    6566      this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
    6667        "al weights.");
     
    6970      //
    7071      this.initializationGroupBox.Location = new System.Drawing.Point(6, 7);
    71       this.initializationGroupBox.Size = new System.Drawing.Size(379, 73);
     72      this.initializationGroupBox.Size = new System.Drawing.Size(391, 73);
    7273      //
    7374      // weightSigmaLabel
     
    7778      // weightInitializationSigmaTextBox
    7879      //
     80      this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(293, 20);
    7981      this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
    8082        "weights.");
     
    8385      //
    8486      this.mutationGroupBox.Location = new System.Drawing.Point(6, 86);
    85       this.mutationGroupBox.Size = new System.Drawing.Size(379, 73);
     87      this.mutationGroupBox.Size = new System.Drawing.Size(391, 95);
    8688      //
    8789      // multiplicativeWeightChangeLabel
    8890      //
     91      this.multiplicativeWeightChangeLabel.TabIndex = 4;
    8992      this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
    9093        " change in weight.");
     
    9295      // multiplicativeWeightChangeSigmaTextBox
    9396      //
     97      this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5;
    9498      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
    9599        "tive change in weight.");
     
    97101      // additiveWeightChangeLabel
    98102      //
     103      this.additiveWeightChangeLabel.TabIndex = 2;
    99104      this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    100105        "change in weight.");
     
    102107      // additiveWeightChangeSigmaTextBox
    103108      //
     109      this.additiveWeightChangeSigmaTextBox.TabIndex = 3;
    104110      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    105111        "change in weight.");
     
    111117      // parametersTabPage
    112118      //
    113       this.parametersTabPage.Size = new System.Drawing.Size(400, 149);
     119      this.parametersTabPage.Size = new System.Drawing.Size(412, 208);
    114120      //
    115121      // tabControl
    116122      //
    117123      this.tabControl.Location = new System.Drawing.Point(0, 179);
    118       this.tabControl.Size = new System.Drawing.Size(408, 175);
    119       this.tabControl.TabIndex = 9;
     124      this.tabControl.Size = new System.Drawing.Size(420, 234);
     125      this.tabControl.TabIndex = 13;
     126      //
     127      // varChangeProbTextBox
     128      //
     129      this.varChangeProbTextBox.TabIndex = 1;
     130      this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
     131        "change in weight.");
     132      //
     133      // varChangeProbLabel
     134      //
     135      this.varChangeProbLabel.TabIndex = 0;
     136      this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" +
     137        "s are sampled uniformly.");
    120138      //
    121139      // initialFrequencyLabel
    122140      //
     141      this.initialFrequencyLabel.TabIndex = 2;
    123142      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
    124143      //
     
    126145      //
    127146      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     147      this.initialFrequencyTextBox.Size = new System.Drawing.Size(323, 20);
     148      this.initialFrequencyTextBox.TabIndex = 3;
     149      //
     150      // enabledCheckBox
     151      //
     152      this.enabledCheckBox.TabIndex = 8;
     153      //
     154      // minimumArityLabel
     155      //
     156      this.minimumArityLabel.TabIndex = 4;
     157      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
     158      //
     159      // maximumArityLabel
     160      //
     161      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
    128162      //
    129163      // minimumArityTextBox
    130164      //
    131165      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    132       this.minimumArityTextBox.Size = new System.Drawing.Size(315, 20);
     166      this.minimumArityTextBox.Size = new System.Drawing.Size(327, 20);
     167      this.minimumArityTextBox.TabIndex = 5;
    133168      //
    134169      // maximumArityTextBox
    135170      //
    136171      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    137       this.maximumArityTextBox.Size = new System.Drawing.Size(315, 20);
     172      this.maximumArityTextBox.Size = new System.Drawing.Size(327, 20);
    138173      //
    139174      // nameTextBox
     
    141176      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    142177      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
     178      this.nameTextBox.Size = new System.Drawing.Size(302, 20);
     179      //
     180      // infoLabel
     181      //
     182      this.infoLabel.Location = new System.Drawing.Point(401, 3);
    143183      //
    144184      // minTimeOffsetLabel
     
    148188      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
    149189      this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
    150       this.minTimeOffsetLabel.TabIndex = 5;
     190      this.minTimeOffsetLabel.TabIndex = 9;
    151191      this.minTimeOffsetLabel.Text = "Min. time offset:";
    152192      //
     
    157197      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
    158198      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
    159       this.maxTimeOffsetLabel.TabIndex = 7;
     199      this.maxTimeOffsetLabel.TabIndex = 11;
    160200      this.maxTimeOffsetLabel.Text = "Max. time offset:";
    161201      //
    162202      // minTimeOffsetTextBox
    163203      //
    164       this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     204      this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    165205            | System.Windows.Forms.AnchorStyles.Right)));
    166206      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127);
    167207      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
    168       this.minTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
    169       this.minTimeOffsetTextBox.TabIndex = 6;
     208      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20);
     209      this.minTimeOffsetTextBox.TabIndex = 10;
    170210      this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged);
    171211      //
    172212      // maxTimeOffsetTextBox
    173213      //
    174       this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     214      this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    175215            | System.Windows.Forms.AnchorStyles.Right)));
    176216      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153);
    177217      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
    178       this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
    179       this.maxTimeOffsetTextBox.TabIndex = 8;
     218      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20);
     219      this.maxTimeOffsetTextBox.TabIndex = 12;
    180220      this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged);
    181221      //
    182222      // LaggedVariableView
    183223      //
    184       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    185224      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    186225      this.Controls.Add(this.minTimeOffsetTextBox);
     
    189228      this.Controls.Add(this.maxTimeOffsetTextBox);
    190229      this.Name = "LaggedVariableView";
    191       this.Size = new System.Drawing.Size(408, 352);
     230      this.Size = new System.Drawing.Size(420, 411);
     231      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
    192232      this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0);
    193233      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5151      this.weightInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
    5252      this.mutationGroupBox = new System.Windows.Forms.GroupBox();
     53      this.varChangeProbTextBox = new System.Windows.Forms.TextBox();
     54      this.varChangeProbLabel = new System.Windows.Forms.Label();
    5355      this.multiplicativeWeightChangeLabel = new System.Windows.Forms.Label();
    5456      this.multiplicativeWeightChangeSigmaTextBox = new System.Windows.Forms.TextBox();
     
    6769      // initialFrequencyLabel
    6870      //
     71      this.initialFrequencyLabel.TabIndex = 2;
    6972      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
    7073      //
     
    7376      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    7477      this.initialFrequencyTextBox.Size = new System.Drawing.Size(311, 20);
     78      this.initialFrequencyTextBox.TabIndex = 3;
     79      //
     80      // enabledCheckBox
     81      //
     82      this.enabledCheckBox.TabIndex = 8;
    7583      //
    7684      // minimumArityLabel
    7785      //
     86      this.minimumArityLabel.TabIndex = 4;
    7887      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
    7988      //
     
    8695      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    8796      this.minimumArityTextBox.Size = new System.Drawing.Size(311, 20);
     97      this.minimumArityTextBox.TabIndex = 5;
    8898      //
    8999      // maximumArityTextBox
     
    165175      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    166176            | System.Windows.Forms.AnchorStyles.Right)));
     177      this.mutationGroupBox.Controls.Add(this.varChangeProbTextBox);
     178      this.mutationGroupBox.Controls.Add(this.varChangeProbLabel);
    167179      this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeLabel);
    168180      this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeSigmaTextBox);
     
    171183      this.mutationGroupBox.Location = new System.Drawing.Point(6, 85);
    172184      this.mutationGroupBox.Name = "mutationGroupBox";
    173       this.mutationGroupBox.Size = new System.Drawing.Size(391, 73);
     185      this.mutationGroupBox.Size = new System.Drawing.Size(391, 97);
    174186      this.mutationGroupBox.TabIndex = 1;
    175187      this.mutationGroupBox.TabStop = false;
    176188      this.mutationGroupBox.Text = "Mutation";
    177189      //
     190      // varChangeProbTextBox
     191      //
     192      this.varChangeProbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     193            | System.Windows.Forms.AnchorStyles.Right)));
     194      this.varChangeProbTextBox.Location = new System.Drawing.Point(201, 13);
     195      this.varChangeProbTextBox.Name = "varChangeProbTextBox";
     196      this.varChangeProbTextBox.Size = new System.Drawing.Size(184, 20);
     197      this.varChangeProbTextBox.TabIndex = 1;
     198      this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
     199        "change in weight.");
     200      this.varChangeProbTextBox.TextChanged += new System.EventHandler(this.VarProbTextBox_TextChanged);
     201      //
     202      // varChangeProbLabel
     203      //
     204      this.varChangeProbLabel.AutoSize = true;
     205      this.varChangeProbLabel.Location = new System.Drawing.Point(6, 16);
     206      this.varChangeProbLabel.Name = "varChangeProbLabel";
     207      this.varChangeProbLabel.Size = new System.Drawing.Size(134, 13);
     208      this.varChangeProbLabel.TabIndex = 0;
     209      this.varChangeProbLabel.Text = "Variable change probability";
     210      this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" +
     211        "s are sampled uniformly.");
     212      //
    178213      // multiplicativeWeightChangeLabel
    179214      //
    180215      this.multiplicativeWeightChangeLabel.AutoSize = true;
    181       this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 48);
     216      this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 68);
    182217      this.multiplicativeWeightChangeLabel.Name = "multiplicativeWeightChangeLabel";
    183218      this.multiplicativeWeightChangeLabel.Size = new System.Drawing.Size(180, 13);
    184       this.multiplicativeWeightChangeLabel.TabIndex = 2;
     219      this.multiplicativeWeightChangeLabel.TabIndex = 4;
    185220      this.multiplicativeWeightChangeLabel.Text = "Multiplicative weight change (sigma):";
    186221      this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
     
    191226      this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    192227            | System.Windows.Forms.AnchorStyles.Right)));
    193       this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 45);
     228      this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 65);
    194229      this.multiplicativeWeightChangeSigmaTextBox.Name = "multiplicativeWeightChangeSigmaTextBox";
    195230      this.multiplicativeWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20);
    196       this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 3;
     231      this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5;
    197232      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
    198233        "tive change in weight.");
     
    202237      //
    203238      this.additiveWeightChangeLabel.AutoSize = true;
    204       this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 22);
     239      this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 42);
    205240      this.additiveWeightChangeLabel.Name = "additiveWeightChangeLabel";
    206241      this.additiveWeightChangeLabel.Size = new System.Drawing.Size(157, 13);
    207       this.additiveWeightChangeLabel.TabIndex = 0;
     242      this.additiveWeightChangeLabel.TabIndex = 2;
    208243      this.additiveWeightChangeLabel.Text = "Additive weight change (sigma):";
    209244      this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
     
    214249      this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    215250            | System.Windows.Forms.AnchorStyles.Right)));
    216       this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 19);
     251      this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 39);
    217252      this.additiveWeightChangeSigmaTextBox.Name = "additiveWeightChangeSigmaTextBox";
    218253      this.additiveWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20);
    219       this.additiveWeightChangeSigmaTextBox.TabIndex = 1;
     254      this.additiveWeightChangeSigmaTextBox.TabIndex = 3;
    220255      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    221256        "change in weight.");
     
    232267      this.tabControl.Name = "tabControl";
    233268      this.tabControl.SelectedIndex = 0;
    234       this.tabControl.Size = new System.Drawing.Size(408, 190);
    235       this.tabControl.TabIndex = 5;
     269      this.tabControl.Size = new System.Drawing.Size(408, 216);
     270      this.tabControl.TabIndex = 9;
    236271      //
    237272      // variableNamesTabPage
     
    240275      this.variableNamesTabPage.Name = "variableNamesTabPage";
    241276      this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
    242       this.variableNamesTabPage.Size = new System.Drawing.Size(400, 164);
     277      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 190);
    243278      this.variableNamesTabPage.TabIndex = 0;
    244279      this.variableNamesTabPage.Text = "Variable Names";
     
    252287      this.parametersTabPage.Name = "parametersTabPage";
    253288      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
    254       this.parametersTabPage.Size = new System.Drawing.Size(400, 164);
     289      this.parametersTabPage.Size = new System.Drawing.Size(400, 190);
    255290      this.parametersTabPage.TabIndex = 1;
    256291      this.parametersTabPage.Text = "Parameters";
     
    259294      // VariableView
    260295      //
    261       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    262296      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    263297      this.Controls.Add(this.tabControl);
    264298      this.Name = "VariableView";
    265       this.Size = new System.Drawing.Size(408, 317);
     299      this.Size = new System.Drawing.Size(408, 346);
     300      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
    266301      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
    267302      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
     
    301336    protected System.Windows.Forms.TabPage parametersTabPage;
    302337    protected System.Windows.Forms.TabControl tabControl;
     338    protected System.Windows.Forms.TextBox varChangeProbTextBox;
     339    protected System.Windows.Forms.Label varChangeProbLabel;
    303340  }
    304341}
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2929using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    3030using HeuristicLab.MainForm;
    31 using HeuristicLab.MainForm.WindowsForms;
    3231
    3332
    3433namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3534  [View("Variable View")]
    36   [Content(typeof(Variable), true)]
     35  [Content(typeof(VariableBase), true)]
    3736  public partial class VariableView : SymbolView {
    3837    private CheckedItemCollectionView<StringValue> variableNamesView;
    3938
    40     public new Variable Content {
    41       get { return (Variable)base.Content; }
     39    public new VariableBase Content {
     40      get { return (VariableBase)base.Content; }
    4241      set { base.Content = value; }
    4342    }
     
    101100      multiplicativeWeightChangeSigmaTextBox.Enabled = Content != null;
    102101      multiplicativeWeightChangeSigmaTextBox.ReadOnly = ReadOnly;
     102      varChangeProbTextBox.Enabled = Content != null;
     103      varChangeProbTextBox.ReadOnly = ReadOnly;
    103104    }
    104105
     
    175176      }
    176177    }
     178
     179    private void VarProbTextBox_TextChanged(object sender, EventArgs e) {
     180      double prob;
     181      if (double.TryParse(varChangeProbTextBox.Text, out prob) && prob >= 0.0 && prob <= 1.0) {
     182        Content.VariableChangeProbability = prob;
     183        errorProvider.SetError(varChangeProbTextBox, string.Empty);
     184      } else {
     185        errorProvider.SetError(varChangeProbTextBox, "Invalid value");
     186      }
     187    }
    177188    #endregion
    178189
     
    184195        additiveWeightChangeSigmaTextBox.Text = string.Empty;
    185196        multiplicativeWeightChangeSigmaTextBox.Text = string.Empty;
     197        varChangeProbTextBox.Text = string.Empty;
    186198        // temporarily deregister to prevent circular calling of events
    187199        DeregisterVariableNamesViewContentEvents();
     
    201213        additiveWeightChangeSigmaTextBox.Text = Content.WeightManipulatorSigma.ToString();
    202214        multiplicativeWeightChangeSigmaTextBox.Text = Content.MultiplicativeWeightManipulatorSigma.ToString();
     215        varChangeProbTextBox.Text = Content.VariableChangeProbability.ToString();
    203216      }
    204217      SetEnabledStateOfControls();
    205218    }
    206219    #endregion
     220
    207221  }
    208222}
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeConstantNodeEditDialog.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5757      this.okButton = new System.Windows.Forms.Button();
    5858      this.cancelButton = new System.Windows.Forms.Button();
     59      this.variableNameTextBox = new System.Windows.Forms.TextBox();
    5960      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    6061      this.SuspendLayout();
     
    168169      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
    169170      //
     171      // variableNameTextBox
     172      //
     173      this.variableNameTextBox.Location = new System.Drawing.Point(101, 63);
     174      this.variableNameTextBox.Name = "variableNameTextBox";
     175      this.variableNameTextBox.Size = new System.Drawing.Size(127, 20);
     176      this.variableNameTextBox.TabIndex = 11;
     177      this.variableNameTextBox.Visible = false;
     178      //
    170179      // InsertNodeDialog
    171180      //
     
    175184      this.ClientSize = new System.Drawing.Size(241, 133);
    176185      this.ControlBox = false;
     186      this.Controls.Add(this.variableNameTextBox);
    177187      this.Controls.Add(this.cancelButton);
    178188      this.Controls.Add(this.okButton);
     
    208218    private System.Windows.Forms.Button cancelButton;
    209219    private System.Windows.Forms.Button okButton;
     220    private System.Windows.Forms.TextBox variableNameTextBox;
    210221  }
    211222}
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeNodeInsertDialog.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323using System.Collections.Generic;
    2424using System.ComponentModel;
     25using System.Linq;
    2526using System.Text;
    2627using System.Windows.Forms;
     
    3031namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3132  public partial class InsertNodeDialog : Form {
     33    public string SelectedVariableName {
     34      get {
     35        var variable = SelectedSymbol as Variable;
     36        if (variable == null)
     37          return string.Empty;
     38        return variable.VariableNames.Any() ? variableNamesCombo.Text : variableNameTextBox.Text;
     39      }
     40    }
     41
    3242    public InsertNodeDialog() {
    3343      InitializeComponent();
     
    4050    }
    4151
    42     public ISymbol SelectedSymbol() {
    43       return (ISymbol)allowedSymbolsCombo.SelectedItem;
     52    public ISymbol SelectedSymbol {
     53      get { return (ISymbol)allowedSymbolsCombo.SelectedItem; }
    4454    }
    4555
     
    5565        constantValueLabel.Visible = true;
    5666        constantValueTextBox.Visible = true;
    57       } else if (symbol is Variable) {
    58         var variable = (Variable)symbol;
    59         foreach (var name in variable.VariableNames) variableNamesCombo.Items.Add(name);
    60         variableNamesCombo.SelectedIndex = 0;
     67      } else if (symbol is VariableBase) {
     68        var variableSymbol = (VariableBase)symbol;
     69        if (variableSymbol.VariableNames.Any()) {
     70          foreach (var name in variableSymbol.VariableNames)
     71            variableNamesCombo.Items.Add(name);
     72          variableNamesCombo.SelectedIndex = 0;
     73          variableNamesCombo.Visible = true;
     74          variableNameTextBox.Visible = false;
     75        } else {
     76          variableNamesCombo.Visible = false;
     77          variableNameTextBox.Visible = true;
     78        }
    6179        variableNameLabel.Visible = true;
    62         variableNamesCombo.Visible = true;
    6380        variableWeightLabel.Visible = true;
    6481        variableWeightTextBox.Visible = true;
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    5555      this.okButton = new System.Windows.Forms.Button();
    5656      this.cancelButton = new System.Windows.Forms.Button();
     57      this.variableNameTextBox = new System.Windows.Forms.TextBox();
    5758      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    5859      this.SuspendLayout();
     
    146147      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
    147148      //
     149      // variableNameTextBox
     150      //
     151      this.variableNameTextBox.Location = new System.Drawing.Point(101, 12);
     152      this.variableNameTextBox.Name = "variableNameTextBox";
     153      this.variableNameTextBox.Size = new System.Drawing.Size(131, 20);
     154      this.variableNameTextBox.TabIndex = 12;
     155      this.variableNameTextBox.Visible = false;
     156      //
    148157      // VariableNodeEditDialog
    149158      //
     
    154163      this.ClientSize = new System.Drawing.Size(244, 134);
    155164      this.ControlBox = false;
     165      this.Controls.Add(this.variableNameTextBox);
    156166      this.Controls.Add(this.cancelButton);
    157167      this.Controls.Add(this.okButton);
     
    188198    public System.Windows.Forms.TextBox newValueTextBox;
    189199    public System.Windows.Forms.ComboBox variableNamesCombo;
     200    private System.Windows.Forms.TextBox variableNameTextBox;
    190201  }
    191202}
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TreeEditDialogs/SymbolicExpressionTreeVariableNodeEditDialog.cs

    r12012 r15973  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System;
    2323using System.ComponentModel;
     24using System.Linq;
    2425using System.Text;
    2526using System.Windows.Forms;
     
    3334      get { return variableTreeNode; }
    3435      set {
    35         if (InvokeRequired)
    36           Invoke(new Action<SymbolicExpressionTreeNode>(x => variableTreeNode = (VariableTreeNode)x), value);
    37         else
     36        if (InvokeRequired) {
     37          Invoke(new Action<SymbolicExpressionTreeNode>(x =>
     38          {
     39            variableTreeNode = (VariableTreeNode) x;
     40            variableNameTextBox.Text = variableTreeNode.VariableName;
     41          }), value);
     42        } else {
    3843          variableTreeNode = value;
     44          variableNameTextBox.Text = variableTreeNode.VariableName;
     45        }
    3946      }
     47    }
     48
     49    public string SelectedVariableName {
     50      get { return variableNamesCombo.Visible ? variableNamesCombo.Text : variableNameTextBox.Text; }
    4051    }
    4152
     
    4354      InitializeComponent();
    4455      oldValueTextBox.TabStop = false; // cannot receive focus using tab key
    45 
    4656      NewNode = (VariableTreeNode)node; // will throw an invalid cast exception if node is not of the correct type
    4757      InitializeFields();
     
    5767        variableNameLabel.Visible = true;
    5868        variableNamesCombo.Visible = true;
    59         foreach (var name in variableTreeNode.Symbol.VariableNames) variableNamesCombo.Items.Add(name);
    60         variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName);
     69        if (variableTreeNode.Symbol.VariableNames.Any()) {
     70          foreach (var name in variableTreeNode.Symbol.VariableNames)
     71            variableNamesCombo.Items.Add(name);
     72          variableNamesCombo.SelectedIndex = variableNamesCombo.Items.IndexOf(variableTreeNode.VariableName);
     73          variableNamesCombo.Visible = true;
     74          variableNameTextBox.Visible = false;
     75        } else {
     76          variableNamesCombo.Visible = false;
     77          variableNameTextBox.Visible = true;
     78        }
    6179      }
    6280    }
     
    93111    #region combo box validation and events
    94112    private void variableNamesCombo_Validating(object sender, CancelEventArgs e) {
     113      if (variableNamesCombo.Items.Count == 0) return;
    95114      if (variableNamesCombo.Items.Contains(variableNamesCombo.SelectedItem)) return;
    96115      e.Cancel = true;
     
    119138    private void OnDialogValidated(object sender, EventArgs e) {
    120139      double weight = double.Parse(newValueTextBox.Text);
    121       var variableName = (string)variableNamesCombo.SelectedItem;
    122140      // we impose an extra validation condition: that the weight/value be different than the original ones
     141      var variableName = SelectedVariableName;
    123142      if (variableTreeNode.Weight.Equals(weight) && variableTreeNode.VariableName.Equals(variableName)) return;
    124143      variableTreeNode.Weight = weight;
  • branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/displayModelFrame.html

    r7446 r15973  
    1 <!-- this file is derived from sample.html from the MathJax distribution -->
    2 <!-- Copyright (c) 2009-2011 Design Science, Inc. -->
     1<!-- this file is derived from sample_tex.html from the MathJax distribution -->
     2<!-- Copyright (c) 2010-2015 The MathJax Consortium -->
    33<!-- adapted by HEAL for HeuristicLab-->
    44<!DOCTYPE html>
    55<html>
    66<head>
    7   <!-- title change by HEAL -->
    8   <title>Symbolic Expression Tree</title>
    9   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    10   <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    11   <script type="text/x-mathjax-config">
    12   MathJax.Hub.Config({
    13     extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    14     jax: ["input/TeX","output/HTML-CSS"],
    15     tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
    16     imageFont: null
    17   });
    18  
    19 </script>
    20   <script type="text/javascript" src="./MathJax.js"></script>
    21   <!-- begin changes by HEAL -->
    22   <script type="text/javascript">
    23   function refreshModel() {
    24     var model = document.getElementById("model");
    25     MathJax.Hub.Queue(["Typeset",MathJax.Hub,model]);
    26   }
    27 </script>
    28   <!-- end changes by HEAL -->
    29   <style>
    30 h1 {text-align:center}
    31 h2 {
    32   font-weight: bold;
    33   background-color: #DDDDDD;
    34   padding: .2em .5em;
    35   margin-top: 1.5em;
    36   border-top: 3px solid #666666;
    37   border-bottom: 2px solid #999999;
    38 }
    39 </style>
     7    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     8    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
     9    <meta name="viewport" content="width=device-width, initial-scale=1">
     10
     11    <!-- title change by HEAL -->
     12    <title>Symbolic Expression Tree</title>
     13
     14    <script type="text/x-mathjax-config">
     15        MathJax.Hub.Config({
     16        extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
     17        jax: ["input/TeX","output/SVG"],
     18        tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]},
     19        "HTML-CSS": {preferredFont: "STIX-Web"},
     20        MathMenu: { showLocale:false},
     21        imageFont: null
     22        });
     23    </script>
     24
     25    <script type="text/javascript" async
     26            src="./MathJax/MathJax.js?config=TeX-AMS_SVG&locale=en">
     27    </script>
     28    <script type="text/javascript">
     29        <!-- necessary to re-typeset when the model is changed-->
     30        function refreshModel() {
     31            var model = document.getElementById("model");
     32            <!-- see https://docs.mathjax.org/en/v1.1-latest/typeset.html -->
     33            MathJax.Hub.Queue(["Typeset",MathJax.Hub,model]);
     34        }
     35    </script>
    4036</head>
    4137<body id="body">
    42   <noscript>
    43     <div style="color: #CC0000; text-align: center">
    44       <b>Warning: <a href="http://www.mathjax.org/">MathJax</a> requires JavaScript to process
    45         the mathematics on this page.<br />
    46         If your browser supports JavaScript, be sure it is enabled.</b>
    47     </div>
    48     <hr>
    49   </noscript>
    50   <p id="model">
    51   </p>
     38    <noscript>
     39        <div style="color: #CC0000; text-align: center">
     40            <b>
     41                Warning: <a href="http://www.mathjax.org/">MathJax</a> requires JavaScript to process
     42                the mathematics on this page.<br />
     43                If your browser supports JavaScript, be sure it is enabled.
     44            </b>
     45        </div>
     46        <hr>
     47    </noscript>
     48    <p id="model">
     49    </p>
    5250</body>
    5351</html>
Note: See TracChangeset for help on using the changeset viewer.