Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/08/13 15:36:13 (12 years ago)
Author:
mkommend
Message:

#1837: Updated sliding window GP branch with trunk changes.

Location:
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
Files:
1 deleted
21 edited
4 copied

Legend:

Unmodified
Added
Removed
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4

    • Property svn:ignore
      •  

        old new  
        22obj
        33*.user
        4 HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin.cs
        54*.vs10x
        65Plugin.cs
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.cs

    r7446 r9126  
    2626namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    2727  [View("Graphical Representation")]
    28   [Content(typeof(ISymbolicDataAnalysisModel))]
     28  [Content(typeof(ISymbolicDataAnalysisModel), true)]
    2929  public partial class GraphicalSymbolicDataAnalysisModelView : AsynchronousContentView {
    3030    public GraphicalSymbolicDataAnalysisModelView()
     
    4040    protected override void OnContentChanged() {
    4141      base.OnContentChanged();
     42      symbolicExpressionTreeView.Content = null;
    4243      if (Content != null)
    4344        symbolicExpressionTreeView.Content = Content.SymbolicExpressionTree;
    44       else
    45         symbolicExpressionTreeView.Content = null;
    4645    }
    4746  }
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/GraphicalSymbolicDataAnalysisModelView.designer.cs

    r7259 r9126  
    6464      this.AllowDrop = true;
    6565      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    66       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     66      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    6767      this.Controls.Add(this.symbolicExpressionTreeView);
    6868      this.Name = "SymbolicExpressionModelView";
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r7850 r9126  
    9393  </PropertyGroup>
    9494  <ItemGroup>
    95     <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    96       <HintPath>..\..\..\..\trunk\sources\bin\ALGLIB-3.5.0.dll</HintPath>
     95    <Reference Include="ALGLIB-3.6.0, Version=3.6.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     96      <HintPath>..\..\bin\ALGLIB-3.6.0.dll</HintPath>
     97      <Private>False</Private>
    9798    </Reference>
    9899    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     
    164165  </ItemGroup>
    165166  <ItemGroup>
     167    <Compile Include="InteractiveSymbolicExpressionTreeChart.cs">
     168      <SubType>UserControl</SubType>
     169    </Compile>
     170    <Compile Include="InteractiveSymbolicExpressionTreeChart.Designer.cs">
     171      <DependentUpon>InteractiveSymbolicExpressionTreeChart.cs</DependentUpon>
     172    </Compile>
    166173    <Compile Include="MathSymbolicDataAnalysisModelView.cs">
    167174      <SubType>UserControl</SubType>
     
    224231    <Compile Include="Symbols\VariableView.Designer.cs">
    225232      <DependentUpon>VariableView.cs</DependentUpon>
     233    </Compile>
     234    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeConstantNodeEditDialog.cs">
     235      <SubType>Form</SubType>
     236    </Compile>
     237    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeConstantNodeEditDialog.Designer.cs">
     238      <DependentUpon>SymbolicExpressionTreeConstantNodeEditDialog.cs</DependentUpon>
     239    </Compile>
     240    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeVariableNodeEditDialog.cs">
     241      <SubType>Form</SubType>
     242    </Compile>
     243    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeVariableNodeEditDialog.Designer.cs">
     244      <DependentUpon>SymbolicExpressionTreeVariableNodeEditDialog.cs</DependentUpon>
     245    </Compile>
     246    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeInsertDialog.cs">
     247      <SubType>Form</SubType>
     248    </Compile>
     249    <Compile Include="TreeEditDialogs\SymbolicExpressionTreeNodeInsertDialog.Designer.cs">
     250      <DependentUpon>SymbolicExpressionTreeNodeInsertDialog.cs</DependentUpon>
    226251    </Compile>
    227252    <None Include="HeuristicLab.snk" />
     
    279304  -->
    280305  <PropertyGroup>
    281     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     306    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    282307set ProjectDir=$(ProjectDir)
    283308set SolutionDir=$(SolutionDir)
     
    286311call PreBuildEvent.cmd
    287312</PreBuildEvent>
     313    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     314export ProjectDir=$(ProjectDir)
     315export SolutionDir=$(SolutionDir)
     316
     317$SolutionDir/PreBuildEvent.sh
     318</PreBuildEvent>
    288319  </PropertyGroup>
    289320</Project>
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.Designer.cs

    r6256 r9126  
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
     47      this.components = new System.ComponentModel.Container();
    4848      this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    4949      this.splitContainer = new System.Windows.Forms.SplitContainer();
    5050      this.grpSimplify = new System.Windows.Forms.GroupBox();
     51      this.treeStatusValue = new System.Windows.Forms.Label();
    5152      this.flowLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
     53      this.btnOptimizeConstants = new System.Windows.Forms.Button();
    5254      this.btnSimplify = new System.Windows.Forms.Button();
    53       this.btnOptimizeConstants = new System.Windows.Forms.Button();
     55      this.treeStatusLabel = new System.Windows.Forms.Label();
     56      this.treeChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.InteractiveSymbolicExpressionTreeChart();
    5457      this.grpViewHost = new System.Windows.Forms.GroupBox();
    5558      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
     
    6265      this.SuspendLayout();
    6366      //
    64       // treeChart
    65       //
    66       this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    67             | System.Windows.Forms.AnchorStyles.Left)
    68             | System.Windows.Forms.AnchorStyles.Right)));
    69       this.treeChart.BackgroundColor = System.Drawing.Color.White;
    70       this.treeChart.LineColor = System.Drawing.Color.Black;
    71       this.treeChart.Location = new System.Drawing.Point(6, 16);
    72       this.treeChart.Name = "treeChart";
    73       this.treeChart.Size = new System.Drawing.Size(201, 291);
    74       this.treeChart.Spacing = 5;
    75       this.treeChart.TabIndex = 0;
    76       this.treeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
    77       this.treeChart.Tree = null;
    78       this.treeChart.SymbolicExpressionTreeNodeDoubleClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeDoubleClicked);
    79       //
    8067      // viewHost
    8168      //
    82       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    83             | System.Windows.Forms.AnchorStyles.Left) 
     69      this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     70            | System.Windows.Forms.AnchorStyles.Left)
    8471            | System.Windows.Forms.AnchorStyles.Right)));
    8572      this.viewHost.Caption = "View";
     
    8976      this.viewHost.Name = "viewHost";
    9077      this.viewHost.ReadOnly = false;
    91       this.viewHost.Size = new System.Drawing.Size(335, 326);
     78      this.viewHost.Size = new System.Drawing.Size(336, 383);
    9279      this.viewHost.TabIndex = 0;
    9380      this.viewHost.ViewsLabelVisible = true;
     
    10794      //
    10895      this.splitContainer.Panel2.Controls.Add(this.grpViewHost);
    109       this.splitContainer.Size = new System.Drawing.Size(564, 348);
     96      this.splitContainer.Size = new System.Drawing.Size(565, 405);
    11097      this.splitContainer.SplitterDistance = 213;
    11198      this.splitContainer.TabIndex = 1;
     
    113100      // grpSimplify
    114101      //
     102      this.grpSimplify.AutoSize = true;
     103      this.grpSimplify.Controls.Add(this.treeStatusValue);
    115104      this.grpSimplify.Controls.Add(this.flowLayoutPanel);
     105      this.grpSimplify.Controls.Add(this.treeStatusLabel);
    116106      this.grpSimplify.Controls.Add(this.treeChart);
    117107      this.grpSimplify.Dock = System.Windows.Forms.DockStyle.Fill;
    118108      this.grpSimplify.Location = new System.Drawing.Point(0, 0);
    119109      this.grpSimplify.Name = "grpSimplify";
    120       this.grpSimplify.Size = new System.Drawing.Size(213, 348);
     110      this.grpSimplify.Size = new System.Drawing.Size(213, 405);
    121111      this.grpSimplify.TabIndex = 1;
    122112      this.grpSimplify.TabStop = false;
    123113      this.grpSimplify.Text = "Simplify";
    124114      //
     115      // treeStatusValue
     116      //
     117      this.treeStatusValue.AutoSize = true;
     118      this.treeStatusValue.BackColor = System.Drawing.Color.Transparent;
     119      this.treeStatusValue.ForeColor = System.Drawing.Color.Green;
     120      this.treeStatusValue.Location = new System.Drawing.Point(72, 16);
     121      this.treeStatusValue.Name = "treeStatusValue";
     122      this.treeStatusValue.Size = new System.Drawing.Size(30, 13);
     123      this.treeStatusValue.TabIndex = 3;
     124      this.treeStatusValue.Text = "Valid";
     125      //
    125126      // flowLayoutPanel
    126127      //
    127       this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
     128      this.flowLayoutPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    128129            | System.Windows.Forms.AnchorStyles.Right)));
    129130      this.flowLayoutPanel.Controls.Add(this.btnSimplify);
    130131      this.flowLayoutPanel.Controls.Add(this.btnOptimizeConstants);
    131       this.flowLayoutPanel.Location = new System.Drawing.Point(6, 313);
     132      this.flowLayoutPanel.Location = new System.Drawing.Point(6, 370);
    132133      this.flowLayoutPanel.Name = "flowLayoutPanel";
    133134      this.flowLayoutPanel.Size = new System.Drawing.Size(204, 29);
    134135      this.flowLayoutPanel.TabIndex = 2;
    135136      this.flowLayoutPanel.WrapContents = false;
    136       //
    137       // btnSimplify
    138       //
    139       this.btnSimplify.Location = new System.Drawing.Point(3, 3);
    140       this.btnSimplify.Name = "btnSimplify";
    141       this.btnSimplify.Size = new System.Drawing.Size(95, 23);
    142       this.btnSimplify.TabIndex = 1;
    143       this.btnSimplify.Text = "Simplify";
    144       this.btnSimplify.UseVisualStyleBackColor = true;
    145       this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
    146137      //
    147138      // btnOptimizeConstants
     
    157148      this.btnOptimizeConstants.Click += new System.EventHandler(this.btnOptimizeConstants_Click);
    158149      //
     150      // btnSimplify
     151      //
     152      this.btnSimplify.Location = new System.Drawing.Point(3, 3);
     153      this.btnSimplify.Name = "btnSimplify";
     154      this.btnSimplify.Size = new System.Drawing.Size(95, 23);
     155      this.btnSimplify.TabIndex = 1;
     156      this.btnSimplify.Text = "Simplify";
     157      this.btnSimplify.UseVisualStyleBackColor = true;
     158      this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
     159      //
     160      // treeStatusLabel
     161      //
     162      this.treeStatusLabel.AutoSize = true;
     163      this.treeStatusLabel.BackColor = System.Drawing.Color.Transparent;
     164      this.treeStatusLabel.Location = new System.Drawing.Point(6, 16);
     165      this.treeStatusLabel.Name = "treeStatusLabel";
     166      this.treeStatusLabel.Size = new System.Drawing.Size(68, 13);
     167      this.treeStatusLabel.TabIndex = 2;
     168      this.treeStatusLabel.Text = "Tree Status: ";
     169      //
     170      // treeChart
     171      //
     172      this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     173            | System.Windows.Forms.AnchorStyles.Left)
     174            | System.Windows.Forms.AnchorStyles.Right)));
     175      this.treeChart.BackgroundColor = System.Drawing.Color.White;
     176      this.treeChart.LineColor = System.Drawing.Color.Black;
     177      this.treeChart.Location = new System.Drawing.Point(6, 32);
     178      this.treeChart.ModifyTree = null;
     179      this.treeChart.Name = "treeChart";
     180      this.treeChart.Size = new System.Drawing.Size(201, 332);
     181      this.treeChart.Spacing = 5;
     182      this.treeChart.SuspendRepaint = false;
     183      this.treeChart.TabIndex = 0;
     184      this.treeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
     185      this.treeChart.Tree = null;
     186      this.treeChart.SymbolicExpressionTreeNodeDoubleClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeDoubleClicked);
     187      //
    159188      // grpViewHost
    160189      //
     
    163192      this.grpViewHost.Location = new System.Drawing.Point(0, 0);
    164193      this.grpViewHost.Name = "grpViewHost";
    165       this.grpViewHost.Size = new System.Drawing.Size(347, 348);
     194      this.grpViewHost.Size = new System.Drawing.Size(348, 405);
    166195      this.grpViewHost.TabIndex = 1;
    167196      this.grpViewHost.TabStop = false;
     
    173202      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    174203      this.Controls.Add(this.splitContainer);
     204      this.DoubleBuffered = true;
    175205      this.Name = "InteractiveSymbolicDataAnalysisSolutionSimplifierView";
    176       this.Size = new System.Drawing.Size(564, 348);
     206      this.Size = new System.Drawing.Size(565, 405);
    177207      this.splitContainer.Panel1.ResumeLayout(false);
     208      this.splitContainer.Panel1.PerformLayout();
    178209      this.splitContainer.Panel2.ResumeLayout(false);
    179210      ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
    180211      this.splitContainer.ResumeLayout(false);
    181212      this.grpSimplify.ResumeLayout(false);
     213      this.grpSimplify.PerformLayout();
    182214      this.flowLayoutPanel.ResumeLayout(false);
    183215      this.grpViewHost.ResumeLayout(false);
     
    188220    #endregion
    189221
    190     private HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart treeChart;
     222    private InteractiveSymbolicExpressionTreeChart treeChart;
    191223    private System.Windows.Forms.SplitContainer splitContainer;
    192224    private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
     
    196228    private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel;
    197229    protected System.Windows.Forms.Button btnOptimizeConstants;
     230    private System.Windows.Forms.Label treeStatusValue;
     231    private System.Windows.Forms.Label treeStatusLabel;
    198232  }
    199233}
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs

    r7259 r9126  
    3232namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3333  public abstract partial class InteractiveSymbolicDataAnalysisSolutionSimplifierView : AsynchronousContentView {
    34     private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> replacementNodes;
     34    private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> foldedNodes;
     35    private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> changedNodes;
    3536    private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts;
    36     private bool updateInProgress = false;
     37    private enum TreeState { Valid, Invalid }
     38    private TreeState treeState;
    3739
    3840    public InteractiveSymbolicDataAnalysisSolutionSimplifierView() {
    3941      InitializeComponent();
    40       this.replacementNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
    41       this.nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>();
     42      foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
     43      changedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
     44      nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>();
    4245      this.Caption = "Interactive Solution Simplifier";
     46
     47      // initialize the tree modifier that will be used to perform edit operations over the tree
     48      treeChart.ModifyTree = Modify;
     49    }
     50
     51    /// <summary>
     52    /// Remove, Replace or Insert subtrees
     53    /// </summary>
     54    /// <param name="tree">The symbolic expression tree</param>
     55    /// <param name="node">The insertion point (ie, the parent node who will receive a new child)</param>
     56    /// <param name="oldChild">The subtree to be replaced</param>
     57    /// <param name="newChild">The replacement subtree</param>
     58    /// <param name="removeSubtree">Flag used to indicate if whole subtrees should be removed (default behavior), or just the subtree root</param>
     59    private void Modify(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode node, ISymbolicExpressionTreeNode oldChild, ISymbolicExpressionTreeNode newChild, bool removeSubtree = true) {
     60      if (oldChild == null && newChild == null) throw new ArgumentException();
     61      if (oldChild == null) { // insertion operation
     62        node.AddSubtree(newChild);
     63        newChild.Parent = node;
     64      } else if (newChild == null) { // removal operation
     65        node.RemoveSubtree(node.IndexOfSubtree(oldChild));
     66        changedNodes.Remove(oldChild);
     67        foldedNodes.Remove(oldChild);
     68        if (removeSubtree) {
     69          foreach (var subtree in oldChild.IterateNodesPrefix()) {
     70            changedNodes.Remove(subtree);
     71            foldedNodes.Remove(subtree);
     72          }
     73        } else {
     74          for (int i = oldChild.SubtreeCount - 1; i >= 0; --i) {
     75            var subtree = oldChild.GetSubtree(i);
     76            oldChild.RemoveSubtree(i);
     77            node.AddSubtree(subtree);
     78          }
     79        }
     80      } else { // replacement operation
     81        var replacementIndex = node.IndexOfSubtree(oldChild);
     82        node.RemoveSubtree(replacementIndex);
     83        node.InsertSubtree(replacementIndex, newChild);
     84        newChild.Parent = node;
     85        if (changedNodes.ContainsKey(oldChild)) {
     86          changedNodes.Add(newChild, changedNodes[oldChild]); // so that on double click the original node is restored
     87          changedNodes.Remove(oldChild);
     88        } else {
     89          changedNodes.Add(newChild, oldChild);
     90        }
     91      }
     92      if (IsValid(tree)) {
     93        treeState = TreeState.Valid;
     94        UpdateModel(Content.Model.SymbolicExpressionTree);
     95      } else {
     96        treeState = TreeState.Invalid;
     97      }
     98    }
     99
     100    private bool IsValid(ISymbolicExpressionTree tree) {
     101      treeChart.Tree = tree;
     102      treeChart.Repaint();
     103      bool valid = !tree.IterateNodesPostfix().Any(node => node.SubtreeCount < node.Symbol.MinimumArity || node.SubtreeCount > node.Symbol.MaximumArity);
     104      if (valid) {
     105        btnOptimizeConstants.Enabled = true;
     106        btnSimplify.Enabled = true;
     107        treeStatusValue.Text = "Valid";
     108        treeStatusValue.ForeColor = Color.Green;
     109      } else {
     110        btnOptimizeConstants.Enabled = false;
     111        btnSimplify.Enabled = false;
     112        treeStatusValue.Text = "Invalid";
     113        treeStatusValue.ForeColor = Color.Red;
     114      }
     115      this.Refresh();
     116      return valid;
    43117    }
    44118
     
    50124    protected override void RegisterContentEvents() {
    51125      base.RegisterContentEvents();
    52       Content.ModelChanged += new EventHandler(Content_ModelChanged);
    53       Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
     126      Content.ModelChanged += Content_Changed;
     127      Content.ProblemDataChanged += Content_Changed;
    54128    }
    55129    protected override void DeregisterContentEvents() {
    56130      base.DeregisterContentEvents();
    57       Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    58       Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    59     }
    60 
    61     private void Content_ModelChanged(object sender, EventArgs e) {
    62       OnModelChanged();
    63     }
    64     private void Content_ProblemDataChanged(object sender, EventArgs e) {
    65       OnProblemDataChanged();
    66     }
    67 
    68     protected virtual void OnModelChanged() {
    69       this.CalculateReplacementNodesAndNodeImpacts();
    70     }
    71 
    72     protected virtual void OnProblemDataChanged() {
    73       this.CalculateReplacementNodesAndNodeImpacts();
     131      Content.ModelChanged -= Content_Changed;
     132      Content.ProblemDataChanged -= Content_Changed;
     133    }
     134
     135    private void Content_Changed(object sender, EventArgs e) {
     136      UpdateView();
    74137    }
    75138
    76139    protected override void OnContentChanged() {
    77140      base.OnContentChanged();
    78       this.CalculateReplacementNodesAndNodeImpacts();
    79       this.viewHost.Content = this.Content;
    80     }
    81 
    82     private void CalculateReplacementNodesAndNodeImpacts() {
    83       if (Content != null && Content.Model != null && Content.ProblemData != null) {
    84         var tree = Content.Model.SymbolicExpressionTree;
    85         var replacementValues = CalculateReplacementValues(tree);
    86         foreach (var pair in replacementValues) {
    87           if (!(pair.Key is ConstantTreeNode)) {
    88             replacementNodes[pair.Key] = MakeConstantTreeNode(pair.Value);
    89           }
    90         }
    91         nodeImpacts = CalculateImpactValues(Content.Model.SymbolicExpressionTree);
    92 
    93         if (!updateInProgress) {
    94           // automatically fold all branches with impact = 1
    95           List<ISymbolicExpressionTreeNode> nodeList = Content.Model.SymbolicExpressionTree.Root.GetSubtree(0).IterateNodesPrefix().ToList();
    96           foreach (var parent in nodeList) {
    97             for (int subTreeIndex = 0; subTreeIndex < parent.SubtreeCount; subTreeIndex++) {
    98               var child = parent.GetSubtree(subTreeIndex);
    99               if (!(child.Symbol is Constant) && nodeImpacts[child].IsAlmost(0.0)) {
    100                 SwitchNodeWithReplacementNode(parent, subTreeIndex);
    101               }
    102             }
    103           }
    104         }
    105 
    106         // show only interesting part of solution
    107         if (tree.Root.SubtreeCount > 1)
    108           this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB + ADFs
    109         else
    110           this.treeChart.Tree = new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); // 1st child of RPB
    111         this.PaintNodeImpacts();
    112       }
     141      foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
     142      UpdateView();
     143      viewHost.Content = this.Content;
     144    }
     145
     146    private void UpdateView() {
     147      if (Content == null || Content.Model == null || Content.ProblemData == null) return;
     148      var tree = Content.Model.SymbolicExpressionTree;
     149      treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
     150
     151      var replacementValues = CalculateReplacementValues(tree);
     152      foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) {
     153        foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value);
     154      }
     155
     156      nodeImpacts = CalculateImpactValues(tree);
     157      PaintNodeImpacts();
    113158    }
    114159
     
    117162    protected abstract void UpdateModel(ISymbolicExpressionTree tree);
    118163
    119     private ConstantTreeNode MakeConstantTreeNode(double value) {
    120       Constant constant = new Constant();
    121       constant.MinValue = value - 1;
    122       constant.MaxValue = value + 1;
    123       ConstantTreeNode constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
     164    private static ConstantTreeNode MakeConstantTreeNode(double value) {
     165      var constant = new Constant { MinValue = value - 1, MaxValue = value + 1 };
     166      var constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
    124167      constantTreeNode.Value = value;
    125168      return constantTreeNode;
     
    127170
    128171    private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
    129       VisualSymbolicExpressionTreeNode visualTreeNode = (VisualSymbolicExpressionTreeNode)sender;
     172      if (treeState == TreeState.Invalid) return;
     173      var visualNode = (VisualSymbolicExpressionTreeNode)sender;
     174      var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.SymbolicExpressionTreeNode;
     175      if (symbExprTreeNode == null) return;
    130176      var tree = Content.Model.SymbolicExpressionTree;
    131       foreach (SymbolicExpressionTreeNode treeNode in tree.IterateNodesPostfix()) {
    132         for (int i = 0; i < treeNode.SubtreeCount; i++) {
    133           ISymbolicExpressionTreeNode subTree = treeNode.GetSubtree(i);
    134           // only allow to replace nodes for which a replacement value is known (replacement value for ADF nodes are not available)
    135           if (subTree == visualTreeNode.SymbolicExpressionTreeNode && replacementNodes.ContainsKey(subTree)) {
    136             SwitchNodeWithReplacementNode(treeNode, i);
    137 
    138             // show only interesting part of solution
    139             if (tree.Root.SubtreeCount > 1)
    140               this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB + ADFs
    141             else
    142               this.treeChart.Tree = new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); // 1st child of RPB
    143 
    144             updateInProgress = true;
    145             UpdateModel(tree);
    146             updateInProgress = false;
    147             return; // break all loops
    148           }
    149         }
    150       }
     177      var parent = symbExprTreeNode.Parent;
     178      int indexOfSubtree = parent.IndexOfSubtree(symbExprTreeNode);
     179      if (changedNodes.ContainsKey(symbExprTreeNode)) {
     180        // undo node change
     181        parent.RemoveSubtree(indexOfSubtree);
     182        var originalNode = changedNodes[symbExprTreeNode];
     183        parent.InsertSubtree(indexOfSubtree, originalNode);
     184        changedNodes.Remove(symbExprTreeNode);
     185      } else if (foldedNodes.ContainsKey(symbExprTreeNode)) {
     186        // undo node folding
     187        SwitchNodeWithReplacementNode(parent, indexOfSubtree);
     188      }
     189      UpdateModel(tree);
    151190    }
    152191
     
    154193      ISymbolicExpressionTreeNode subTree = parent.GetSubtree(subTreeIndex);
    155194      parent.RemoveSubtree(subTreeIndex);
    156       if (replacementNodes.ContainsKey(subTree)) {
    157         var replacementNode = replacementNodes[subTree];
     195      if (foldedNodes.ContainsKey(subTree)) {
     196        var replacementNode = foldedNodes[subTree];
    158197        parent.InsertSubtree(subTreeIndex, replacementNode);
    159198        // exchange key and value
    160         replacementNodes.Remove(subTree);
    161         replacementNodes.Add(replacementNode, subTree);
     199        foldedNodes.Remove(subTree);
     200        foldedNodes.Add(replacementNode, subTree);
    162201      }
    163202    }
     
    168207      double min = impacts.Min();
    169208      foreach (ISymbolicExpressionTreeNode treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {
     209        VisualSymbolicExpressionTreeNode visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
     210
    170211        if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) {
    171212          double impact = nodeImpacts[treeNode];
    172           VisualSymbolicExpressionTreeNode visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
    173213
    174214          // impact = 0 if no change
     
    185225          }
    186226          visualTree.ToolTip += Environment.NewLine + "Node impact: " + impact;
    187           var constantReplacementNode = replacementNodes[treeNode] as ConstantTreeNode;
     227          var constantReplacementNode = foldedNodes[treeNode] as ConstantTreeNode;
    188228          if (constantReplacementNode != null) {
    189229            visualTree.ToolTip += Environment.NewLine + "Replacement value: " + constantReplacementNode.Value;
    190230          }
    191231        }
    192       }
    193       this.PaintCollapsedNodes();
    194       this.treeChart.Repaint();
    195     }
    196 
    197     private void PaintCollapsedNodes() {
    198       foreach (ISymbolicExpressionTreeNode treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {
    199         if (treeNode is ConstantTreeNode && replacementNodes.ContainsKey(treeNode))
    200           this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.DarkOrange;
    201         else {
    202           VisualSymbolicExpressionTreeNode visNode = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
    203           if (visNode != null)
    204             visNode.LineColor = Color.Black;
    205         }
    206       }
     232        if (visualTree != null)
     233          if (changedNodes.ContainsKey(treeNode)) {
     234            visualTree.LineColor = Color.DodgerBlue;
     235          } else if (treeNode is ConstantTreeNode && foldedNodes.ContainsKey(treeNode)) {
     236            visualTree.LineColor = Color.DarkOrange;
     237          }
     238      }
     239      treeChart.RepaintNodes();
    207240    }
    208241
    209242    private void btnSimplify_Click(object sender, EventArgs e) {
    210       SymbolicDataAnalysisExpressionTreeSimplifier simplifier = new SymbolicDataAnalysisExpressionTreeSimplifier();
     243      var simplifier = new SymbolicDataAnalysisExpressionTreeSimplifier();
    211244      var simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
    212245      UpdateModel(simplifiedExpressionTree);
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/MathSymbolicDataAnalysisModelView.cs

    r7446 r9126  
    2121
    2222using System;
     23using System.IO;
    2324using System.Windows.Forms;
    2425using HeuristicLab.MainForm;
    2526using HeuristicLab.MainForm.WindowsForms;
    26 using System.Threading;
    27 using System.IO;
    2827
    2928namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3029  [View("Mathematical Representation")]
    31   [Content(typeof(ISymbolicDataAnalysisModel), true)]
     30  [Content(typeof(ISymbolicDataAnalysisModel))]
    3231  public partial class MathSymbolicDataAnalysisModelView : AsynchronousContentView {
    3332    private SymbolicDataAnalysisExpressionLatexFormatter formatter = new SymbolicDataAnalysisExpressionLatexFormatter();
     
    4241
    4342      string hlDir = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
    44       webBrowser.Navigate("file://"+Path.Combine(hlDir, "displayModelFrame.html"));
     43      webBrowser.Navigate("file://" + Path.Combine(hlDir, "displayModelFrame.html"));
    4544    }
    4645
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/MathSymbolicDataAnalysisModelView.designer.cs

    r7446 r9126  
    6666      this.AllowDrop = true;
    6767      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    68       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     68      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    6969      this.Controls.Add(this.webBrowser);
    7070      this.Name = "MathSymbolicDataAnalysisModelView";
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame

    r7675 r9126  
    2626
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    28   [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.2.$WCREV$")]
     28  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.3.$WCREV$")]
    2929  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginFile("displayModelFrame.html", PluginFileType.Data)]
    31   [PluginDependency("HeuristicLab.ALGLIB", "3.5")]
     31  [PluginDependency("HeuristicLab.ALGLIB", "3.6.0")]
    3232  [PluginDependency("HeuristicLab.Collections", "3.3")]
    3333  [PluginDependency("HeuristicLab.Common", "3.3")]
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties

    • Property svn:ignore
      --- 
      +++ 
      
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Properties/AssemblyInfo.cs.frame

    r7259 r9126  
    5353// by using the '*' as shown below:
    5454[assembly: AssemblyVersion("3.4.0.0")]
    55 [assembly: AssemblyFileVersion("3.4.2.$WCREV$")]
     55[assembly: AssemblyFileVersion("3.4.3.$WCREV$")]
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.Designer.cs

    r7259 r9126  
    101101      //
    102102      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    103       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     103      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    104104      this.Controls.Add(this.variableImpactsGroupBox);
    105105      this.Controls.Add(this.foldsLabel);
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/ConstantView.Designer.cs

    r7259 r9126  
    214214      //
    215215      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    216       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     216      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    217217      this.Controls.Add(this.mutationGroupBox);
    218218      this.Controls.Add(this.initializationGroupBox);
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs

    r7259 r9126  
    183183      //
    184184      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    185       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     185      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    186186      this.Controls.Add(this.minTimeOffsetTextBox);
    187187      this.Controls.Add(this.maxTimeOffsetLabel);
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/TimeLagView.Designer.cs

    r7259 r9126  
    123123      //
    124124      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    125       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     125      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    126126      this.Controls.Add(this.maxTimeOffsetTextBox);
    127127      this.Controls.Add(this.minTimeOffsetTextBox);
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.Designer.cs

    r6819 r9126  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4646    /// </summary>
    4747    private void InitializeComponent() {
    48       this.thresholdInitializationMuLabel = new System.Windows.Forms.Label();
    49       this.thresholdInitializationMuTextBox = new System.Windows.Forms.TextBox();
    50       this.initializationGroupBox = new System.Windows.Forms.GroupBox();
    51       this.slopeInitializationSigmaLabel = new System.Windows.Forms.Label();
    52       this.slopeInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
    53       this.slopeInitializationMuLabel = new System.Windows.Forms.Label();
    54       this.slopeInitializationMuTextBox = new System.Windows.Forms.TextBox();
    55       this.thresholdInitializationSigmaLabel = new System.Windows.Forms.Label();
    56       this.thresholdInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
    5748      this.mutationGroupBox = new System.Windows.Forms.GroupBox();
    5849      this.slopeChangeSigmaLabel = new System.Windows.Forms.Label();
     
    6455      this.ThresholdChangeMuLabel = new System.Windows.Forms.Label();
    6556      this.thresholdChangeMuTextBox = new System.Windows.Forms.TextBox();
     57      this.tabControl = new System.Windows.Forms.TabControl();
     58      this.variableNamesTabPage = new System.Windows.Forms.TabPage();
     59      this.parametersTabPage = new System.Windows.Forms.TabPage();
     60      this.initializationGroupBox = new System.Windows.Forms.GroupBox();
     61      this.slopeInitializationSigmaLabel = new System.Windows.Forms.Label();
     62      this.slopeInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
     63      this.slopeInitializationMuLabel = new System.Windows.Forms.Label();
     64      this.slopeInitializationMuTextBox = new System.Windows.Forms.TextBox();
     65      this.thresholdInitializationSigmaLabel = new System.Windows.Forms.Label();
     66      this.thresholdInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
     67      this.thresholdInitializationMuLabel = new System.Windows.Forms.Label();
     68      this.thresholdInitializationMuTextBox = new System.Windows.Forms.TextBox();
    6669      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
     70      this.mutationGroupBox.SuspendLayout();
     71      this.tabControl.SuspendLayout();
     72      this.parametersTabPage.SuspendLayout();
    6773      this.initializationGroupBox.SuspendLayout();
    68       this.mutationGroupBox.SuspendLayout();
    6974      this.SuspendLayout();
    7075      //
     
    7681      //
    7782      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    78       this.initialFrequencyTextBox.Size = new System.Drawing.Size(233, 20);
     83      this.initialFrequencyTextBox.Size = new System.Drawing.Size(427, 20);
     84      //
     85      // minimumArityLabel
     86      //
     87      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
     88      //
     89      // maximumArityLabel
     90      //
     91      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
    7992      //
    8093      // minimumArityTextBox
    8194      //
    8295      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     96      this.minimumArityTextBox.Size = new System.Drawing.Size(421, 20);
    8397      //
    8498      // maximumArityTextBox
    8599      //
    86100      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     101      this.maximumArityTextBox.Size = new System.Drawing.Size(421, 20);
    87102      //
    88103      // nameTextBox
     
    90105      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    91106      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
    92       this.nameTextBox.Size = new System.Drawing.Size(203, 20);
    93       //
    94       // thresholdInitializationMuLabel
    95       //
    96       this.thresholdInitializationMuLabel.AutoSize = true;
    97       this.thresholdInitializationMuLabel.Location = new System.Drawing.Point(6, 18);
    98       this.thresholdInitializationMuLabel.Name = "thresholdInitializationMuLabel";
    99       this.thresholdInitializationMuLabel.Size = new System.Drawing.Size(80, 13);
    100       this.thresholdInitializationMuLabel.TabIndex = 0;
    101       this.thresholdInitializationMuLabel.Text = "Threshold (mu):";
    102       this.toolTip.SetToolTip(this.thresholdInitializationMuLabel, "The mu (mean) parameter of the normal distribution to use for initial weights.");
    103       //
    104       // thresholdInitializationMuTextBox
    105       //
    106       this.thresholdInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    107             | System.Windows.Forms.AnchorStyles.Right)));
    108       this.thresholdInitializationMuTextBox.Location = new System.Drawing.Point(114, 15);
    109       this.thresholdInitializationMuTextBox.Name = "thresholdInitializationMuTextBox";
    110       this.thresholdInitializationMuTextBox.Size = new System.Drawing.Size(203, 20);
    111       this.thresholdInitializationMuTextBox.TabIndex = 1;
    112       this.toolTip.SetToolTip(this.thresholdInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
    113         "al thresholds.");
    114       this.thresholdInitializationMuTextBox.TextChanged += new System.EventHandler(this.thresholdMuTextBox_TextChanged);
     107      this.nameTextBox.Size = new System.Drawing.Size(397, 20);
     108      //
     109      // infoLabel
     110      //
     111      this.infoLabel.Location = new System.Drawing.Point(495, 3);
     112      //
     113      // mutationGroupBox
     114      //
     115      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     116                  | System.Windows.Forms.AnchorStyles.Right)));
     117      this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaLabel);
     118      this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaTextBox);
     119      this.mutationGroupBox.Controls.Add(this.slopeChangeMuLabel);
     120      this.mutationGroupBox.Controls.Add(this.slopeChangeMuTextBox);
     121      this.mutationGroupBox.Controls.Add(this.thresholdChangeSigmaLabel);
     122      this.mutationGroupBox.Controls.Add(this.thresholdChangeSigmaTextBox);
     123      this.mutationGroupBox.Controls.Add(this.ThresholdChangeMuLabel);
     124      this.mutationGroupBox.Controls.Add(this.thresholdChangeMuTextBox);
     125      this.mutationGroupBox.Location = new System.Drawing.Point(6, 142);
     126      this.mutationGroupBox.Name = "mutationGroupBox";
     127      this.mutationGroupBox.Size = new System.Drawing.Size(503, 126);
     128      this.mutationGroupBox.TabIndex = 6;
     129      this.mutationGroupBox.TabStop = false;
     130      this.mutationGroupBox.Text = "Mutation";
     131      //
     132      // slopeChangeSigmaLabel
     133      //
     134      this.slopeChangeSigmaLabel.AutoSize = true;
     135      this.slopeChangeSigmaLabel.Location = new System.Drawing.Point(6, 102);
     136      this.slopeChangeSigmaLabel.Name = "slopeChangeSigmaLabel";
     137      this.slopeChangeSigmaLabel.Size = new System.Drawing.Size(112, 13);
     138      this.slopeChangeSigmaLabel.TabIndex = 6;
     139      this.slopeChangeSigmaLabel.Text = "Slope change (sigma):";
     140      this.toolTip.SetToolTip(this.slopeChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in sl" +
     141              "ope.");
     142      //
     143      // slopeChangeSigmaTextBox
     144      //
     145      this.slopeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     146                  | System.Windows.Forms.AnchorStyles.Right)));
     147      this.slopeChangeSigmaTextBox.Location = new System.Drawing.Point(149, 99);
     148      this.slopeChangeSigmaTextBox.Name = "slopeChangeSigmaTextBox";
     149      this.slopeChangeSigmaTextBox.Size = new System.Drawing.Size(345, 20);
     150      this.slopeChangeSigmaTextBox.TabIndex = 7;
     151      this.toolTip.SetToolTip(this.slopeChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in sl" +
     152              "ope.");
     153      this.slopeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.SlopeChangeSigmaTextBox_TextChanged);
     154      //
     155      // slopeChangeMuLabel
     156      //
     157      this.slopeChangeMuLabel.AutoSize = true;
     158      this.slopeChangeMuLabel.Location = new System.Drawing.Point(6, 76);
     159      this.slopeChangeMuLabel.Name = "slopeChangeMuLabel";
     160      this.slopeChangeMuLabel.Size = new System.Drawing.Size(99, 13);
     161      this.slopeChangeMuLabel.TabIndex = 4;
     162      this.slopeChangeMuLabel.Text = "Slope change (mu):";
     163      this.toolTip.SetToolTip(this.slopeChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in slope" +
     164              ".");
     165      //
     166      // slopeChangeMuTextBox
     167      //
     168      this.slopeChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     169                  | System.Windows.Forms.AnchorStyles.Right)));
     170      this.slopeChangeMuTextBox.Location = new System.Drawing.Point(149, 73);
     171      this.slopeChangeMuTextBox.Name = "slopeChangeMuTextBox";
     172      this.slopeChangeMuTextBox.Size = new System.Drawing.Size(345, 20);
     173      this.slopeChangeMuTextBox.TabIndex = 5;
     174      this.toolTip.SetToolTip(this.slopeChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in slope" +
     175              ".");
     176      this.slopeChangeMuTextBox.TextChanged += new System.EventHandler(this.SlopeChangeMuTextBox_TextChanged);
     177      //
     178      // thresholdChangeSigmaLabel
     179      //
     180      this.thresholdChangeSigmaLabel.AutoSize = true;
     181      this.thresholdChangeSigmaLabel.Location = new System.Drawing.Point(6, 44);
     182      this.thresholdChangeSigmaLabel.Name = "thresholdChangeSigmaLabel";
     183      this.thresholdChangeSigmaLabel.Size = new System.Drawing.Size(132, 13);
     184      this.thresholdChangeSigmaLabel.TabIndex = 2;
     185      this.thresholdChangeSigmaLabel.Text = "Threshold change (sigma):";
     186      this.toolTip.SetToolTip(this.thresholdChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in th" +
     187              "reshold.");
     188      //
     189      // thresholdChangeSigmaTextBox
     190      //
     191      this.thresholdChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     192                  | System.Windows.Forms.AnchorStyles.Right)));
     193      this.thresholdChangeSigmaTextBox.Location = new System.Drawing.Point(149, 41);
     194      this.thresholdChangeSigmaTextBox.Name = "thresholdChangeSigmaTextBox";
     195      this.thresholdChangeSigmaTextBox.Size = new System.Drawing.Size(345, 20);
     196      this.thresholdChangeSigmaTextBox.TabIndex = 3;
     197      this.toolTip.SetToolTip(this.thresholdChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in th" +
     198              "reshold.");
     199      this.thresholdChangeSigmaTextBox.TextChanged += new System.EventHandler(this.ThresholdChangeSigmaTextBox_TextChanged);
     200      //
     201      // ThresholdChangeMuLabel
     202      //
     203      this.ThresholdChangeMuLabel.AutoSize = true;
     204      this.ThresholdChangeMuLabel.Location = new System.Drawing.Point(6, 18);
     205      this.ThresholdChangeMuLabel.Name = "ThresholdChangeMuLabel";
     206      this.ThresholdChangeMuLabel.Size = new System.Drawing.Size(119, 13);
     207      this.ThresholdChangeMuLabel.TabIndex = 0;
     208      this.ThresholdChangeMuLabel.Text = "Threshold change (mu):";
     209      this.toolTip.SetToolTip(this.ThresholdChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in thres" +
     210              "hold.");
     211      //
     212      // thresholdChangeMuTextBox
     213      //
     214      this.thresholdChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     215                  | System.Windows.Forms.AnchorStyles.Right)));
     216      this.thresholdChangeMuTextBox.Location = new System.Drawing.Point(149, 15);
     217      this.thresholdChangeMuTextBox.Name = "thresholdChangeMuTextBox";
     218      this.thresholdChangeMuTextBox.Size = new System.Drawing.Size(345, 20);
     219      this.thresholdChangeMuTextBox.TabIndex = 1;
     220      this.toolTip.SetToolTip(this.thresholdChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in thres" +
     221              "hold.");
     222      this.thresholdChangeMuTextBox.TextChanged += new System.EventHandler(this.ThresholdChangeMuTextBox_TextChanged);
     223      //
     224      // tabControl
     225      //
     226      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     227                  | System.Windows.Forms.AnchorStyles.Left)
     228                  | System.Windows.Forms.AnchorStyles.Right)));
     229      this.tabControl.Controls.Add(this.variableNamesTabPage);
     230      this.tabControl.Controls.Add(this.parametersTabPage);
     231      this.tabControl.Location = new System.Drawing.Point(0, 127);
     232      this.tabControl.Name = "tabControl";
     233      this.tabControl.SelectedIndex = 0;
     234      this.tabControl.Size = new System.Drawing.Size(520, 299);
     235      this.tabControl.TabIndex = 10;
     236      //
     237      // variableNamesTabPage
     238      //
     239      this.variableNamesTabPage.Location = new System.Drawing.Point(4, 22);
     240      this.variableNamesTabPage.Name = "variableNamesTabPage";
     241      this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
     242      this.variableNamesTabPage.Size = new System.Drawing.Size(512, 273);
     243      this.variableNamesTabPage.TabIndex = 0;
     244      this.variableNamesTabPage.Text = "Variable Names";
     245      this.variableNamesTabPage.UseVisualStyleBackColor = true;
     246      //
     247      // parametersTabPage
     248      //
     249      this.parametersTabPage.Controls.Add(this.initializationGroupBox);
     250      this.parametersTabPage.Controls.Add(this.mutationGroupBox);
     251      this.parametersTabPage.Location = new System.Drawing.Point(4, 22);
     252      this.parametersTabPage.Name = "parametersTabPage";
     253      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
     254      this.parametersTabPage.Size = new System.Drawing.Size(512, 273);
     255      this.parametersTabPage.TabIndex = 1;
     256      this.parametersTabPage.Text = "Parameters";
     257      this.parametersTabPage.UseVisualStyleBackColor = true;
    115258      //
    116259      // initializationGroupBox
    117260      //
    118261      this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    119             | System.Windows.Forms.AnchorStyles.Right)));
     262                  | System.Windows.Forms.AnchorStyles.Right)));
    120263      this.initializationGroupBox.Controls.Add(this.slopeInitializationSigmaLabel);
    121264      this.initializationGroupBox.Controls.Add(this.slopeInitializationSigmaTextBox);
     
    126269      this.initializationGroupBox.Controls.Add(this.thresholdInitializationMuLabel);
    127270      this.initializationGroupBox.Controls.Add(this.thresholdInitializationMuTextBox);
    128       this.initializationGroupBox.Location = new System.Drawing.Point(0, 127);
     271      this.initializationGroupBox.Location = new System.Drawing.Point(6, 6);
    129272      this.initializationGroupBox.Name = "initializationGroupBox";
    130       this.initializationGroupBox.Size = new System.Drawing.Size(326, 127);
    131       this.initializationGroupBox.TabIndex = 5;
     273      this.initializationGroupBox.Size = new System.Drawing.Size(503, 130);
     274      this.initializationGroupBox.TabIndex = 6;
    132275      this.initializationGroupBox.TabStop = false;
    133276      this.initializationGroupBox.Text = "Initialization";
     
    146289      //
    147290      this.slopeInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    148             | System.Windows.Forms.AnchorStyles.Right)));
     291                  | System.Windows.Forms.AnchorStyles.Right)));
    149292      this.slopeInitializationSigmaTextBox.Location = new System.Drawing.Point(114, 102);
    150293      this.slopeInitializationSigmaTextBox.Name = "slopeInitializationSigmaTextBox";
    151       this.slopeInitializationSigmaTextBox.Size = new System.Drawing.Size(203, 20);
     294      this.slopeInitializationSigmaTextBox.Size = new System.Drawing.Size(380, 20);
    152295      this.slopeInitializationSigmaTextBox.TabIndex = 7;
    153296      this.toolTip.SetToolTip(this.slopeInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
    154         "slopes.");
    155       this.slopeInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.slopeInitializationSigmaTextBox_TextChanged);
     297              "slopes.");
     298      this.slopeInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.SlopeInitializationSigmaTextBox_TextChanged);
    156299      //
    157300      // slopeInitializationMuLabel
     
    168311      //
    169312      this.slopeInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    170             | System.Windows.Forms.AnchorStyles.Right)));
     313                  | System.Windows.Forms.AnchorStyles.Right)));
    171314      this.slopeInitializationMuTextBox.Location = new System.Drawing.Point(114, 76);
    172315      this.slopeInitializationMuTextBox.Name = "slopeInitializationMuTextBox";
    173       this.slopeInitializationMuTextBox.Size = new System.Drawing.Size(203, 20);
     316      this.slopeInitializationMuTextBox.Size = new System.Drawing.Size(380, 20);
    174317      this.slopeInitializationMuTextBox.TabIndex = 5;
    175318      this.toolTip.SetToolTip(this.slopeInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
    176         "al slopes.");
    177       this.slopeInitializationMuTextBox.TextChanged += new System.EventHandler(this.slopeInitializationMuTextBox_TextChanged);
     319              "al slopes.");
     320      this.slopeInitializationMuTextBox.TextChanged += new System.EventHandler(this.SlopeInitializationMuTextBox_TextChanged);
    178321      //
    179322      // thresholdInitializationSigmaLabel
     
    190333      //
    191334      this.thresholdInitializationSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    192             | System.Windows.Forms.AnchorStyles.Right)));
     335                  | System.Windows.Forms.AnchorStyles.Right)));
    193336      this.thresholdInitializationSigmaTextBox.Location = new System.Drawing.Point(114, 41);
    194337      this.thresholdInitializationSigmaTextBox.Name = "thresholdInitializationSigmaTextBox";
    195       this.thresholdInitializationSigmaTextBox.Size = new System.Drawing.Size(203, 20);
     338      this.thresholdInitializationSigmaTextBox.Size = new System.Drawing.Size(380, 20);
    196339      this.thresholdInitializationSigmaTextBox.TabIndex = 3;
    197340      this.toolTip.SetToolTip(this.thresholdInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
    198         "thresholds.");
    199       this.thresholdInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.thresholdInitializationSigmaTextBox_TextChanged);
    200       //
    201       // mutationGroupBox
    202       //
    203       this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    204             | System.Windows.Forms.AnchorStyles.Right)));
    205       this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaLabel);
    206       this.mutationGroupBox.Controls.Add(this.slopeChangeSigmaTextBox);
    207       this.mutationGroupBox.Controls.Add(this.slopeChangeMuLabel);
    208       this.mutationGroupBox.Controls.Add(this.slopeChangeMuTextBox);
    209       this.mutationGroupBox.Controls.Add(this.thresholdChangeSigmaLabel);
    210       this.mutationGroupBox.Controls.Add(this.thresholdChangeSigmaTextBox);
    211       this.mutationGroupBox.Controls.Add(this.ThresholdChangeMuLabel);
    212       this.mutationGroupBox.Controls.Add(this.thresholdChangeMuTextBox);
    213       this.mutationGroupBox.Location = new System.Drawing.Point(0, 260);
    214       this.mutationGroupBox.Name = "mutationGroupBox";
    215       this.mutationGroupBox.Size = new System.Drawing.Size(326, 127);
    216       this.mutationGroupBox.TabIndex = 6;
    217       this.mutationGroupBox.TabStop = false;
    218       this.mutationGroupBox.Text = "Mutation";
    219       //
    220       // slopeChangeSigmaLabel
    221       //
    222       this.slopeChangeSigmaLabel.AutoSize = true;
    223       this.slopeChangeSigmaLabel.Location = new System.Drawing.Point(6, 102);
    224       this.slopeChangeSigmaLabel.Name = "slopeChangeSigmaLabel";
    225       this.slopeChangeSigmaLabel.Size = new System.Drawing.Size(112, 13);
    226       this.slopeChangeSigmaLabel.TabIndex = 6;
    227       this.slopeChangeSigmaLabel.Text = "Slope change (sigma):";
    228       this.toolTip.SetToolTip(this.slopeChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in sl" +
    229         "ope.");
    230       //
    231       // slopeChangeSigmaTextBox
    232       //
    233       this.slopeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    234             | System.Windows.Forms.AnchorStyles.Right)));
    235       this.slopeChangeSigmaTextBox.Location = new System.Drawing.Point(149, 99);
    236       this.slopeChangeSigmaTextBox.Name = "slopeChangeSigmaTextBox";
    237       this.slopeChangeSigmaTextBox.Size = new System.Drawing.Size(168, 20);
    238       this.slopeChangeSigmaTextBox.TabIndex = 7;
    239       this.toolTip.SetToolTip(this.slopeChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in sl" +
    240         "ope.");
    241       this.slopeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.slopeChangeSigmaTextBox_TextChanged);
    242       //
    243       // slopeChangeMuLabel
    244       //
    245       this.slopeChangeMuLabel.AutoSize = true;
    246       this.slopeChangeMuLabel.Location = new System.Drawing.Point(6, 76);
    247       this.slopeChangeMuLabel.Name = "slopeChangeMuLabel";
    248       this.slopeChangeMuLabel.Size = new System.Drawing.Size(99, 13);
    249       this.slopeChangeMuLabel.TabIndex = 4;
    250       this.slopeChangeMuLabel.Text = "Slope change (mu):";
    251       this.toolTip.SetToolTip(this.slopeChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in slope" +
    252         ".");
    253       //
    254       // slopeChangeMuTextBox
    255       //
    256       this.slopeChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    257             | System.Windows.Forms.AnchorStyles.Right)));
    258       this.slopeChangeMuTextBox.Location = new System.Drawing.Point(149, 73);
    259       this.slopeChangeMuTextBox.Name = "slopeChangeMuTextBox";
    260       this.slopeChangeMuTextBox.Size = new System.Drawing.Size(168, 20);
    261       this.slopeChangeMuTextBox.TabIndex = 5;
    262       this.toolTip.SetToolTip(this.slopeChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in slope" +
    263         ".");
    264       this.slopeChangeMuTextBox.TextChanged += new System.EventHandler(this.slopeChangeMuTextBox_TextChanged);
    265       //
    266       // thresholdChangeSigmaLabel
    267       //
    268       this.thresholdChangeSigmaLabel.AutoSize = true;
    269       this.thresholdChangeSigmaLabel.Location = new System.Drawing.Point(6, 44);
    270       this.thresholdChangeSigmaLabel.Name = "thresholdChangeSigmaLabel";
    271       this.thresholdChangeSigmaLabel.Size = new System.Drawing.Size(132, 13);
    272       this.thresholdChangeSigmaLabel.TabIndex = 2;
    273       this.thresholdChangeSigmaLabel.Text = "Threshold change (sigma):";
    274       this.toolTip.SetToolTip(this.thresholdChangeSigmaLabel, "The sigma parameter for the normal distribution to use to sample the change in th" +
    275         "reshold.");
    276       //
    277       // thresholdChangeSigmaTextBox
    278       //
    279       this.thresholdChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    280             | System.Windows.Forms.AnchorStyles.Right)));
    281       this.thresholdChangeSigmaTextBox.Location = new System.Drawing.Point(149, 41);
    282       this.thresholdChangeSigmaTextBox.Name = "thresholdChangeSigmaTextBox";
    283       this.thresholdChangeSigmaTextBox.Size = new System.Drawing.Size(168, 20);
    284       this.thresholdChangeSigmaTextBox.TabIndex = 3;
    285       this.toolTip.SetToolTip(this.thresholdChangeSigmaTextBox, "The sigma parameter for the normal distribution to use to sample the change in th" +
    286         "reshold.");
    287       this.thresholdChangeSigmaTextBox.TextChanged += new System.EventHandler(this.thresholdChangeSigmaTextBox_TextChanged);
    288       //
    289       // ThresholdChangeMuLabel
    290       //
    291       this.ThresholdChangeMuLabel.AutoSize = true;
    292       this.ThresholdChangeMuLabel.Location = new System.Drawing.Point(6, 18);
    293       this.ThresholdChangeMuLabel.Name = "ThresholdChangeMuLabel";
    294       this.ThresholdChangeMuLabel.Size = new System.Drawing.Size(119, 13);
    295       this.ThresholdChangeMuLabel.TabIndex = 0;
    296       this.ThresholdChangeMuLabel.Text = "Threshold change (mu):";
    297       this.toolTip.SetToolTip(this.ThresholdChangeMuLabel, "The nu (mean) parameter for the normal distribution to sample the change in thres" +
    298         "hold.");
    299       //
    300       // thresholdChangeMuTextBox
    301       //
    302       this.thresholdChangeMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    303             | System.Windows.Forms.AnchorStyles.Right)));
    304       this.thresholdChangeMuTextBox.Location = new System.Drawing.Point(149, 15);
    305       this.thresholdChangeMuTextBox.Name = "thresholdChangeMuTextBox";
    306       this.thresholdChangeMuTextBox.Size = new System.Drawing.Size(168, 20);
    307       this.thresholdChangeMuTextBox.TabIndex = 1;
    308       this.toolTip.SetToolTip(this.thresholdChangeMuTextBox, "The mu (mean) parameter for the normal distribution to sample the change in thres" +
    309         "hold.");
    310       this.thresholdChangeMuTextBox.TextChanged += new System.EventHandler(this.thresholdChangeMuTextBox_TextChanged);
     341              "thresholds.");
     342      this.thresholdInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.ThresholdInitializationSigmaTextBox_TextChanged);
     343      //
     344      // thresholdInitializationMuLabel
     345      //
     346      this.thresholdInitializationMuLabel.AutoSize = true;
     347      this.thresholdInitializationMuLabel.Location = new System.Drawing.Point(6, 18);
     348      this.thresholdInitializationMuLabel.Name = "thresholdInitializationMuLabel";
     349      this.thresholdInitializationMuLabel.Size = new System.Drawing.Size(80, 13);
     350      this.thresholdInitializationMuLabel.TabIndex = 0;
     351      this.thresholdInitializationMuLabel.Text = "Threshold (mu):";
     352      this.toolTip.SetToolTip(this.thresholdInitializationMuLabel, "The mu (mean) parameter of the normal distribution to use for initial weights.");
     353      //
     354      // thresholdInitializationMuTextBox
     355      //
     356      this.thresholdInitializationMuTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     357                  | System.Windows.Forms.AnchorStyles.Right)));
     358      this.thresholdInitializationMuTextBox.Location = new System.Drawing.Point(114, 15);
     359      this.thresholdInitializationMuTextBox.Name = "thresholdInitializationMuTextBox";
     360      this.thresholdInitializationMuTextBox.Size = new System.Drawing.Size(380, 20);
     361      this.thresholdInitializationMuTextBox.TabIndex = 1;
     362      this.toolTip.SetToolTip(this.thresholdInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
     363              "al thresholds.");
     364      this.thresholdInitializationMuTextBox.TextChanged += new System.EventHandler(this.ThresholdInitializationMuTextBox_TextChanged);
    311365      //
    312366      // VariableConditionView
    313367      //
    314       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    315       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    316       this.Controls.Add(this.mutationGroupBox);
    317       this.Controls.Add(this.initializationGroupBox);
     368      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     369      this.Controls.Add(this.tabControl);
    318370      this.Name = "VariableConditionView";
    319       this.Size = new System.Drawing.Size(326, 376);
     371      this.Size = new System.Drawing.Size(520, 426);
    320372      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
    321373      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
     
    323375      this.Controls.SetChildIndex(this.minimumArityTextBox, 0);
    324376      this.Controls.SetChildIndex(this.infoLabel, 0);
    325       this.Controls.SetChildIndex(this.initializationGroupBox, 0);
    326377      this.Controls.SetChildIndex(this.initialFrequencyTextBox, 0);
    327378      this.Controls.SetChildIndex(this.initialFrequencyLabel, 0);
    328379      this.Controls.SetChildIndex(this.nameLabel, 0);
    329380      this.Controls.SetChildIndex(this.nameTextBox, 0);
    330       this.Controls.SetChildIndex(this.mutationGroupBox, 0);
     381      this.Controls.SetChildIndex(this.tabControl, 0);
    331382      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
     383      this.mutationGroupBox.ResumeLayout(false);
     384      this.mutationGroupBox.PerformLayout();
     385      this.tabControl.ResumeLayout(false);
     386      this.parametersTabPage.ResumeLayout(false);
    332387      this.initializationGroupBox.ResumeLayout(false);
    333388      this.initializationGroupBox.PerformLayout();
    334       this.mutationGroupBox.ResumeLayout(false);
    335       this.mutationGroupBox.PerformLayout();
    336389      this.ResumeLayout(false);
    337390      this.PerformLayout();
     
    341394    #endregion
    342395
    343     private System.Windows.Forms.Label thresholdInitializationMuLabel;
    344     private System.Windows.Forms.TextBox thresholdInitializationMuTextBox;
    345     protected System.Windows.Forms.GroupBox initializationGroupBox;
    346     private System.Windows.Forms.Label thresholdInitializationSigmaLabel;
    347     private System.Windows.Forms.TextBox thresholdInitializationSigmaTextBox;
    348396    protected System.Windows.Forms.GroupBox mutationGroupBox;
    349397    private System.Windows.Forms.Label thresholdChangeSigmaLabel;
     
    351399    private System.Windows.Forms.Label ThresholdChangeMuLabel;
    352400    private System.Windows.Forms.TextBox thresholdChangeMuTextBox;
     401    private System.Windows.Forms.Label slopeChangeSigmaLabel;
     402    private System.Windows.Forms.TextBox slopeChangeSigmaTextBox;
     403    private System.Windows.Forms.Label slopeChangeMuLabel;
     404    private System.Windows.Forms.TextBox slopeChangeMuTextBox;
     405    protected System.Windows.Forms.TabControl tabControl;
     406    protected System.Windows.Forms.TabPage variableNamesTabPage;
     407    protected System.Windows.Forms.TabPage parametersTabPage;
     408    protected System.Windows.Forms.GroupBox initializationGroupBox;
    353409    private System.Windows.Forms.Label slopeInitializationSigmaLabel;
    354410    private System.Windows.Forms.TextBox slopeInitializationSigmaTextBox;
    355411    private System.Windows.Forms.Label slopeInitializationMuLabel;
    356412    private System.Windows.Forms.TextBox slopeInitializationMuTextBox;
    357     private System.Windows.Forms.Label slopeChangeSigmaLabel;
    358     private System.Windows.Forms.TextBox slopeChangeSigmaTextBox;
    359     private System.Windows.Forms.Label slopeChangeMuLabel;
    360     private System.Windows.Forms.TextBox slopeChangeMuTextBox;
     413    private System.Windows.Forms.Label thresholdInitializationSigmaLabel;
     414    private System.Windows.Forms.TextBox thresholdInitializationSigmaTextBox;
     415    private System.Windows.Forms.Label thresholdInitializationMuLabel;
     416    private System.Windows.Forms.TextBox thresholdInitializationMuTextBox;
    361417
    362418  }
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableConditionView.cs

    r5809 r9126  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2121
    2222using System;
     23using System.Linq;
    2324using System.Windows.Forms;
     25using HeuristicLab.Collections;
     26using HeuristicLab.Core;
     27using HeuristicLab.Core.Views;
     28using HeuristicLab.Data;
    2429using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    2530using HeuristicLab.MainForm;
     
    3035  [Content(typeof(VariableCondition), true)]
    3136  public partial class VariableConditionView : SymbolView {
     37    private readonly CheckedItemCollectionView<StringValue> variableNamesView;
     38
    3239    public new VariableCondition Content {
    3340      get { return (VariableCondition)base.Content; }
     
    3744    public VariableConditionView() {
    3845      InitializeComponent();
     46      variableNamesView = new CheckedItemCollectionView<StringValue>();
     47      variableNamesView.Dock = DockStyle.Fill;
     48      variableNamesTabPage.Controls.Add(variableNamesView);
     49      variableNamesView.Content = new CheckedItemCollection<StringValue>();
     50
     51      RegisterVariableNamesViewContentEvents();
     52    }
     53
     54    private void RegisterVariableNamesViewContentEvents() {
     55      variableNamesView.Content.ItemsAdded += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     56      variableNamesView.Content.ItemsRemoved += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     57      variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     58      variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     59      foreach (var variable in variableNamesView.Content) {
     60        variable.ValueChanged += new EventHandler(Variable_ValueChanged);
     61      }
     62    }
     63
     64    private void DeregisterVariableNamesViewContentEvents() {
     65      variableNamesView.Content.ItemsAdded -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     66      variableNamesView.Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     67      variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     68      variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     69      foreach (var variable in variableNamesView.Content) {
     70        variable.ValueChanged -= new EventHandler(Variable_ValueChanged);
     71      }
    3972    }
    4073
     
    76109    }
    77110
    78 
    79 
    80111    private void UpdateControl() {
    81112      if (Content == null) {
     
    88119        slopeChangeMuTextBox.Text = string.Empty;
    89120        slopeChangeSigmaTextBox.Text = string.Empty;
     121        // temporarily deregister to prevent circular calling of events
     122        DeregisterVariableNamesViewContentEvents();
     123        variableNamesView.Content.Clear();
     124        RegisterVariableNamesViewContentEvents();
    90125      } else {
     126        // temporarily deregister to prevent circular calling of events
     127        DeregisterVariableNamesViewContentEvents();
     128        variableNamesView.Content.Clear();
     129        foreach (var variableName in Content.AllVariableNames) {
     130          variableNamesView.Content.Add(new StringValue(variableName), Content.VariableNames.Contains(variableName));
     131        }
     132        RegisterVariableNamesViewContentEvents();
     133
    91134        thresholdInitializationMuTextBox.Text = Content.ThresholdInitializerMu.ToString();
    92135        thresholdInitializationSigmaTextBox.Text = Content.ThresholdInitializerSigma.ToString();
     
    102145
    103146    #region control events
    104     private void thresholdMuTextBox_TextChanged(object sender, EventArgs e) {
     147    private void VariableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
     148      foreach (var newVar in e.Items)
     149        newVar.ValueChanged += new EventHandler(Variable_ValueChanged);
     150      foreach (var oldVar in e.OldItems)
     151        oldVar.ValueChanged -= new EventHandler(Variable_ValueChanged);
     152      UpdateContent();
     153    }
     154
     155    private void Variable_ValueChanged(object sender, EventArgs e) {
     156      UpdateContent();
     157    }
     158
     159    private void UpdateContent() {
     160      if (Content != null) {
     161        DeregisterContentEvents();
     162        Content.VariableNames = variableNamesView.Content.CheckedItems.Select(x => x.Value).ToList();
     163        RegisterContentEvents();
     164      }
     165    }
     166
     167    private void ThresholdInitializationMuTextBox_TextChanged(object sender, EventArgs e) {
    105168      double value;
    106169      if (double.TryParse(thresholdInitializationMuTextBox.Text, out value)) {
     
    109172      } else errorProvider.SetError(thresholdInitializationMuTextBox, "Invalid value");
    110173    }
    111     private void thresholdInitializationSigmaTextBox_TextChanged(object sender, EventArgs e) {
     174    private void ThresholdInitializationSigmaTextBox_TextChanged(object sender, EventArgs e) {
    112175      double value;
    113176      if (double.TryParse(thresholdInitializationSigmaTextBox.Text, out value)) {
     
    116179      } else errorProvider.SetError(thresholdInitializationSigmaTextBox, "Invalid value");
    117180    }
    118     private void slopeInitializationMuTextBox_TextChanged(object sender, EventArgs e) {
     181    private void SlopeInitializationMuTextBox_TextChanged(object sender, EventArgs e) {
    119182      double value;
    120183      if (double.TryParse(slopeInitializationMuTextBox.Text, out value)) {
     
    123186      } else errorProvider.SetError(slopeInitializationMuTextBox, "Invalid value");
    124187    }
    125     private void slopeInitializationSigmaTextBox_TextChanged(object sender, EventArgs e) {
     188    private void SlopeInitializationSigmaTextBox_TextChanged(object sender, EventArgs e) {
    126189      double value;
    127190      if (double.TryParse(slopeInitializationSigmaTextBox.Text, out value)) {
     
    131194    }
    132195
    133     private void thresholdChangeMuTextBox_TextChanged(object sender, EventArgs e) {
     196    private void ThresholdChangeMuTextBox_TextChanged(object sender, EventArgs e) {
    134197      double value;
    135198      if (double.TryParse(thresholdChangeMuTextBox.Text, out value)) {
     
    139202    }
    140203
    141     private void thresholdChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
     204    private void ThresholdChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
    142205      double value;
    143206      if (double.TryParse(thresholdChangeSigmaTextBox.Text, out value)) {
     
    146209      } else errorProvider.SetError(thresholdChangeSigmaTextBox, "Invalid value");
    147210    }
    148     private void slopeChangeMuTextBox_TextChanged(object sender, EventArgs e) {
     211    private void SlopeChangeMuTextBox_TextChanged(object sender, EventArgs e) {
    149212      double value;
    150213      if (double.TryParse(slopeChangeMuTextBox.Text, out value)) {
     
    154217    }
    155218
    156     private void slopeChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
     219    private void SlopeChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
    157220      double value;
    158221      if (double.TryParse(slopeChangeSigmaTextBox.Text, out value)) {
     
    162225    }
    163226    #endregion
    164 
    165227  }
    166228}
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs

    r7259 r9126  
    7474      this.initialFrequencyTextBox.Size = new System.Drawing.Size(311, 20);
    7575      //
     76      // minimumArityLabel
     77      //
     78      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
     79      //
     80      // maximumArityLabel
     81      //
     82      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
     83      //
    7684      // minimumArityTextBox
    7785      //
     
    114122      this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
    115123        "al weights.");
    116       this.weightInitializationMuTextBox.TextChanged += new System.EventHandler(this.weightMuTextBox_TextChanged);
     124      this.weightInitializationMuTextBox.TextChanged += new System.EventHandler(this.WeightMuTextBox_TextChanged);
    117125      //
    118126      // initializationGroupBox
     
    151159      this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
    152160        "weights.");
    153       this.weightInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.weightSigmaTextBox_TextChanged);
     161      this.weightInitializationSigmaTextBox.TextChanged += new System.EventHandler(this.WeightSigmaTextBox_TextChanged);
    154162      //
    155163      // mutationGroupBox
     
    189197      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
    190198        "tive change in weight.");
    191       this.multiplicativeWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.multiplicativeWeightChangeSigmaTextBox_TextChanged);
     199      this.multiplicativeWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.MultiplicativeWeightChangeSigmaTextBox_TextChanged);
    192200      //
    193201      // additiveWeightChangeLabel
     
    212220      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    213221        "change in weight.");
    214       this.additiveWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.additiveWeightChangeSigmaTextBox_TextChanged);
     222      this.additiveWeightChangeSigmaTextBox.TextChanged += new System.EventHandler(this.AdditiveWeightChangeSigmaTextBox_TextChanged);
    215223      //
    216224      // tabControl
     
    232240      this.variableNamesTabPage.Name = "variableNamesTabPage";
    233241      this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
    234       this.variableNamesTabPage.Size = new System.Drawing.Size(400, 141);
     242      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 164);
    235243      this.variableNamesTabPage.TabIndex = 0;
    236244      this.variableNamesTabPage.Text = "Variable Names";
     
    252260      //
    253261      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    254       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     262      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    255263      this.Controls.Add(this.tabControl);
    256264      this.Name = "VariableView";
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs

    r7259 r9126  
    5454
    5555    private void RegisterVariableNamesViewContentEvents() {
    56       variableNamesView.Content.ItemsAdded += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    57       variableNamesView.Content.ItemsRemoved += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    58       variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    59       variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
     56      variableNamesView.Content.ItemsAdded += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     57      variableNamesView.Content.ItemsRemoved += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     58      variableNamesView.Content.CheckedItemsChanged += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     59      variableNamesView.Content.CollectionReset += new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
    6060      foreach (var variable in variableNamesView.Content) {
    61         variable.ValueChanged += new EventHandler(variable_ValueChanged);
     61        variable.ValueChanged += new EventHandler(Variable_ValueChanged);
    6262      }
    6363    }
     
    6565
    6666    private void DeregisterVariableNamesViewContentEvents() {
    67       variableNamesView.Content.ItemsAdded -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    68       variableNamesView.Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    69       variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
    70       variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(variableNames_Changed);
     67      variableNamesView.Content.ItemsAdded -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     68      variableNamesView.Content.ItemsRemoved -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     69      variableNamesView.Content.CheckedItemsChanged -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
     70      variableNamesView.Content.CollectionReset -= new CollectionItemsChangedEventHandler<StringValue>(VariableNames_Changed);
    7171      foreach (var variable in variableNamesView.Content) {
    72         variable.ValueChanged -= new EventHandler(variable_ValueChanged);
     72        variable.ValueChanged -= new EventHandler(Variable_ValueChanged);
    7373      }
    7474    }
     
    9292    protected override void SetEnabledStateOfControls() {
    9393      base.SetEnabledStateOfControls();
     94      enabledCheckBox.Enabled = Content != null && Content.VariableNames.Any() && !Locked && !ReadOnly;
    9495      weightInitializationMuTextBox.Enabled = Content != null;
    9596      weightInitializationMuTextBox.ReadOnly = ReadOnly;
     
    109110
    110111    #region control event handlers
    111     private void variableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> args) {
    112       if (args.Items != null)
    113         foreach (var newVar in args.Items)
    114           newVar.ValueChanged += new EventHandler(variable_ValueChanged);
    115       if (args.OldItems != null)
    116         foreach (var oldVar in args.OldItems)
    117           oldVar.ValueChanged -= new EventHandler(variable_ValueChanged);
     112    private void VariableNames_Changed(object sender, CollectionItemsChangedEventArgs<StringValue> e) {
     113      foreach (var newVar in e.Items)
     114        newVar.ValueChanged += new EventHandler(Variable_ValueChanged);
     115      foreach (var oldVar in e.OldItems)
     116        oldVar.ValueChanged -= new EventHandler(Variable_ValueChanged);
    118117      UpdateContent();
    119118    }
    120119
    121     private void variable_ValueChanged(object sender, EventArgs e) {
     120    private void Variable_ValueChanged(object sender, EventArgs e) {
    122121      UpdateContent();
    123122    }
     
    125124    private void UpdateContent() {
    126125      if (Content != null) {
     126        Content.Fixed = true;
    127127        DeregisterContentEvents();
    128128        Content.VariableNames = variableNamesView.Content.CheckedItems.Select(x => x.Value).ToList();
     
    131131    }
    132132
    133 
    134     private void weightMuTextBox_TextChanged(object sender, EventArgs e) {
     133    private void WeightMuTextBox_TextChanged(object sender, EventArgs e) {
    135134      double nu;
    136135      if (double.TryParse(weightInitializationMuTextBox.Text, out nu)) {
     
    141140      }
    142141    }
    143     private void weightSigmaTextBox_TextChanged(object sender, EventArgs e) {
     142    private void WeightSigmaTextBox_TextChanged(object sender, EventArgs e) {
    144143      double sigma;
    145144      if (double.TryParse(weightInitializationSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
     
    151150    }
    152151
    153     private void additiveWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
     152    private void AdditiveWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
    154153      double sigma;
    155154      if (double.TryParse(additiveWeightChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
     
    160159      }
    161160    }
    162     private void multiplicativeWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
     161    private void MultiplicativeWeightChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {
    163162      double sigma;
    164163      if (double.TryParse(multiplicativeWeightChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {
     
    183182        RegisterVariableNamesViewContentEvents();
    184183      } else {
    185         var existingEntries = variableNamesView.Content.ToList();
    186 
    187184        // temporarily deregister to prevent circular calling of events
    188185        DeregisterVariableNamesViewContentEvents();
    189         // add additional entries
    190         foreach (var variableName in Content.VariableNames.Except(existingEntries.Select(x => x.Value)))
    191           variableNamesView.Content.Add(new StringValue(variableName), true);
    192         foreach (var oldEntry in existingEntries.Where(x => !Content.VariableNames.Contains(x.Value)))
    193           variableNamesView.Content.Remove(oldEntry);
     186        variableNamesView.Content.Clear();
     187        foreach (var variableName in Content.AllVariableNames) {
     188          variableNamesView.Content.Add(new StringValue(variableName), Content.VariableNames.Contains(variableName));
     189        }
    194190        RegisterVariableNamesViewContentEvents();
    195191
  • branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/TextualSymbolicDataAnalysisModelView.designer.cs

    r7259 r9126  
    6464      this.AllowDrop = true;
    6565      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    66       this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     66      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    6767      this.Controls.Add(this.symbolicExpressionTreeView);
    6868      this.Name = "SymbolicExpressionModelView";
Note: See TracChangeset for help on using the changeset viewer.