Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/11 19:37:20 (13 years ago)
Author:
gkronber
Message:

#1418 added interactive simplifier view for symbolic regression models.

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
Files:
7 added
4 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs

    r5692 r5699  
    2020#endregion
    2121
    22 namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
     22namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    2323  partial class InteractiveSymbolicRegressionSolutionSimplifierView {
    2424    /// <summary>
     
    4545    /// </summary>
    4646    private void InitializeComponent() {
    47       this.treeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart();
    48       this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost();
    49       this.splitContainer = new System.Windows.Forms.SplitContainer();
    50       this.grpSimplify = new System.Windows.Forms.GroupBox();
    51       this.btnSimplify = new System.Windows.Forms.Button();
    52       this.grpViewHost = new System.Windows.Forms.GroupBox();
    53       this.splitContainer.Panel1.SuspendLayout();
    54       this.splitContainer.Panel2.SuspendLayout();
    55       this.splitContainer.SuspendLayout();
    56       this.grpSimplify.SuspendLayout();
    57       this.grpViewHost.SuspendLayout();
    5847      this.SuspendLayout();
    59       //
    60       // treeChart
    61       //
    62       this.treeChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    63                   | System.Windows.Forms.AnchorStyles.Left)
    64                   | System.Windows.Forms.AnchorStyles.Right)));
    65       this.treeChart.BackgroundColor = System.Drawing.Color.White;
    66       this.treeChart.LineColor = System.Drawing.Color.Black;
    67       this.treeChart.Location = new System.Drawing.Point(6, 16);
    68       this.treeChart.Name = "treeChart";
    69       this.treeChart.Size = new System.Drawing.Size(201, 297);
    70       this.treeChart.Spacing = 5;
    71       this.treeChart.TabIndex = 0;
    72       this.treeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F);
    73       this.treeChart.Tree = null;
    74       this.treeChart.SymbolicExpressionTreeNodeDoubleClicked += new System.Windows.Forms.MouseEventHandler(this.treeChart_SymbolicExpressionTreeNodeDoubleClicked);
    75       //
    76       // viewHost
    77       //
    78       this.viewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    79                   | System.Windows.Forms.AnchorStyles.Left)
    80                   | System.Windows.Forms.AnchorStyles.Right)));
    81       this.viewHost.Caption = "View";
    82       this.viewHost.Content = null;
    83       this.viewHost.Enabled = false;
    84       this.viewHost.Location = new System.Drawing.Point(6, 16);
    85       this.viewHost.Name = "viewHost";
    86       this.viewHost.ReadOnly = false;
    87       this.viewHost.Size = new System.Drawing.Size(335, 326);
    88       this.viewHost.TabIndex = 0;
    89       this.viewHost.ViewType = null;
    90       //
    91       // splitContainer
    92       //
    93       this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
    94       this.splitContainer.Location = new System.Drawing.Point(0, 0);
    95       this.splitContainer.Name = "splitContainer";
    96       //
    97       // splitContainer.Panel1
    98       //
    99       this.splitContainer.Panel1.Controls.Add(this.grpSimplify);
    100       //
    101       // splitContainer.Panel2
    102       //
    103       this.splitContainer.Panel2.Controls.Add(this.grpViewHost);
    104       this.splitContainer.Size = new System.Drawing.Size(564, 348);
    105       this.splitContainer.SplitterDistance = 213;
    106       this.splitContainer.TabIndex = 1;
    107       //
    108       // grpSimplify
    109       //
    110       this.grpSimplify.Controls.Add(this.btnSimplify);
    111       this.grpSimplify.Controls.Add(this.treeChart);
    112       this.grpSimplify.Dock = System.Windows.Forms.DockStyle.Fill;
    113       this.grpSimplify.Location = new System.Drawing.Point(0, 0);
    114       this.grpSimplify.Name = "grpSimplify";
    115       this.grpSimplify.Size = new System.Drawing.Size(213, 348);
    116       this.grpSimplify.TabIndex = 1;
    117       this.grpSimplify.TabStop = false;
    118       this.grpSimplify.Text = "Simplify";
    119       //
    120       // btnSimplify
    121       //
    122       this.btnSimplify.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    123                   | System.Windows.Forms.AnchorStyles.Right)));
    124       this.btnSimplify.Location = new System.Drawing.Point(6, 319);
    125       this.btnSimplify.Name = "btnSimplify";
    126       this.btnSimplify.Size = new System.Drawing.Size(201, 23);
    127       this.btnSimplify.TabIndex = 1;
    128       this.btnSimplify.Text = "Simplify";
    129       this.btnSimplify.UseVisualStyleBackColor = true;
    130       this.btnSimplify.Click += new System.EventHandler(this.btnSimplify_Click);
    131       //
    132       // grpViewHost
    133       //
    134       this.grpViewHost.Controls.Add(this.viewHost);
    135       this.grpViewHost.Dock = System.Windows.Forms.DockStyle.Fill;
    136       this.grpViewHost.Location = new System.Drawing.Point(0, 0);
    137       this.grpViewHost.Name = "grpViewHost";
    138       this.grpViewHost.Size = new System.Drawing.Size(347, 348);
    139       this.grpViewHost.TabIndex = 1;
    140       this.grpViewHost.TabStop = false;
    141       this.grpViewHost.Text = "Details";
    14248      //
    14349      // InteractiveSymbolicRegressionSolutionSimplifierView
     
    14551      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    14652      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    147       this.Controls.Add(this.splitContainer);
    14853      this.Name = "InteractiveSymbolicRegressionSolutionSimplifierView";
    14954      this.Size = new System.Drawing.Size(564, 348);
    150       this.splitContainer.Panel1.ResumeLayout(false);
    151       this.splitContainer.Panel2.ResumeLayout(false);
    152       this.splitContainer.ResumeLayout(false);
    153       this.grpSimplify.ResumeLayout(false);
    154       this.grpViewHost.ResumeLayout(false);
    15555      this.ResumeLayout(false);
    156 
    15756    }
    15857
    15958    #endregion
    160 
    161     private HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart treeChart;
    162     private System.Windows.Forms.SplitContainer splitContainer;
    163     private HeuristicLab.MainForm.WindowsForms.ViewHost viewHost;
    164     private System.Windows.Forms.GroupBox grpSimplify;
    165     private System.Windows.Forms.GroupBox grpViewHost;
    166     private System.Windows.Forms.Button btnSimplify;
    16759  }
    16860}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/InteractiveSymbolicRegressionSolutionSimplifierView.cs

    r5692 r5699  
    2626using System.Windows.Forms;
    2727using HeuristicLab.Common;
     28using HeuristicLab.MainForm.WindowsForms;
     29using HeuristicLab.Problems.DataAnalysis.Symbolic.Views;
    2830using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbols;
    30 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    31 using HeuristicLab.MainForm.WindowsForms;
    32 using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
    33 using HeuristicLab.Problems.DataAnalysis.Symbolic;
    34 using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
    3531
    36 namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
    37   public partial class InteractiveSymbolicRegressionSolutionSimplifierView : AsynchronousContentView {
    38     private SymbolicExpressionTree simplifiedExpressionTree;
    39     private Dictionary<SymbolicExpressionTreeNode, ConstantTreeNode> replacementNodes;
    40     private Dictionary<SymbolicExpressionTreeNode, double> nodeImpacts;
     32namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
     33  public partial class InteractiveSymbolicRegressionSolutionSimplifierView : InteractiveSymbolicDataAnalysisSolutionSimplifierView {
     34    private readonly ConstantTreeNode constantNode;
     35    private readonly SymbolicExpressionTree tempTree;
     36    public InteractiveSymbolicRegressionSolutionSimplifierView()
     37      : base() {
     38      InitializeComponent();
     39      this.Caption = "Interactive Regression Solution Simplifier";
    4140
    42     public InteractiveSymbolicRegressionSolutionSimplifierView() {
    43       InitializeComponent();
    44       this.replacementNodes = new Dictionary<SymbolicExpressionTreeNode, ConstantTreeNode>();
    45       this.nodeImpacts = new Dictionary<SymbolicExpressionTreeNode, double>();
    46       this.simplifiedExpressionTree = null;
    47       this.Caption = "Interactive Solution Simplifier";
     41      constantNode = ((ConstantTreeNode)new Constant().CreateTreeNode());
     42      ISymbolicExpressionTreeNode root = new ProgramRootSymbol().CreateTreeNode();
     43      ISymbolicExpressionTreeNode start = new StartSymbol().CreateTreeNode();
     44      root.AddSubTree(start);
     45      tempTree = new SymbolicExpressionTree(root);
    4846    }
    4947
    50     public new SymbolicRegressionSolution Content {
    51       get { return (SymbolicRegressionSolution)base.Content; }
     48    public new ISymbolicRegressionSolution Content {
     49      get { return (ISymbolicRegressionSolution)base.Content; }
    5250      set { base.Content = value; }
    5351    }
    5452
    55     protected override void RegisterContentEvents() {
    56       base.RegisterContentEvents();
    57       Content.ModelChanged += new EventHandler(Content_ModelChanged);
    58       Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    59     }
    60     protected override void DeregisterContentEvents() {
    61       base.DeregisterContentEvents();
    62       Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    63       Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
     53    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     54      Dictionary<ISymbolicExpressionTreeNode, double> replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
     55      foreach (ISymbolicExpressionTreeNode node in tree.IterateNodesPrefix()) {
     56        if (!(node.Symbol is ProgramRootSymbol || node.Symbol is StartSymbol)) {
     57          replacementValues[node] = CalculateReplacementValue(node, interpreter, dataset, rows);
     58        }
     59      }
     60      return replacementValues;
    6461    }
    6562
    66     private void Content_ModelChanged(object sender, EventArgs e) {
    67       this.CalculateReplacementNodesAndNodeImpacts();
    68     }
    69     private void Content_ProblemDataChanged(object sender, EventArgs e) {
    70       this.CalculateReplacementNodesAndNodeImpacts();
     63    protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree tree, Dataset dataset, IEnumerable<int> rows) {
     64      Dictionary<ISymbolicExpressionTreeNode, double> impactValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
     65      List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubTree(0).GetSubTree(0).IterateNodesPostfix().ToList();
     66      var originalOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows)
     67        .ToArray();
     68
     69      foreach (ISymbolicExpressionTreeNode node in nodes) {
     70        var parent = node.Parent;
     71        constantNode.Value = CalculateReplacementValue(node, interpreter, dataset, rows);
     72        ISymbolicExpressionTreeNode replacementNode = constantNode;
     73        SwitchNode(parent, node, replacementNode);
     74        var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, rows).ToArray();
     75
     76        impactValues[node] = 1 - OnlinePearsonsRSquaredEvaluator.Calculate(originalOutput, newOutput);
     77        SwitchNode(parent, replacementNode, node);
     78      }
     79      return impactValues;
    7180    }
    7281
    73     protected override void OnContentChanged() {
    74       base.OnContentChanged();
    75       this.CalculateReplacementNodesAndNodeImpacts();
    76       this.viewHost.Content = this.Content;
     82    private double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, Dataset dataset, IEnumerable<int> rows) {
     83      var start = tempTree.Root.GetSubTree(0);
     84      while (start.SubTrees.Count() > 0) start.RemoveSubTree(0);
     85      start.AddSubTree((ISymbolicExpressionTreeNode)node.Clone());
     86      return interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, rows).Median();
    7787    }
    7888
    79     private void CalculateReplacementNodesAndNodeImpacts() {
    80       this.replacementNodes.Clear();
    81       this.nodeImpacts.Clear();
    82       if (Content != null && Content.Model != null && Content.ProblemData != null) {
    83         SymbolicSimplifier simplifier = new SymbolicSimplifier();
    84         simplifiedExpressionTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
    85         int samplesStart = Content.ProblemData.TrainingSamplesStart.Value;
    86         int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value;
    87         double originalTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate(
    88             Content.Model.Interpreter, simplifiedExpressionTree, Content.LowerEstimationLimit, Content.UpperEstimationLimit,
    89             Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value,
    90             Enumerable.Range(samplesStart, samplesEnd - samplesStart));
    9189
    92         this.CalculateReplacementNodes();
    93 
    94         this.CalculateNodeImpacts(simplifiedExpressionTree, simplifiedExpressionTree.Root.SubTrees[0], originalTrainingMeanSquaredError);
    95         // automatically fold all branches with impact = 1
    96         List<SymbolicExpressionTreeNode> nodeList = simplifiedExpressionTree.Root.SubTrees[0].IterateNodesPrefix().ToList();
    97         foreach (var parent in nodeList) {
    98           for (int subTreeIndex = 0; subTreeIndex < parent.SubTrees.Count; subTreeIndex++) {
    99             var child = parent.SubTrees[subTreeIndex];
    100             if (!(child.Symbol is Constant) && nodeImpacts[child].IsAlmost(1.0)) {
    101               ReplaceNodeWithConstant(parent, subTreeIndex);
    102             }
    103           }
    104         }
    105         // show only interesting part of solution
    106         this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0].SubTrees[0]);
    107         this.PaintNodeImpacts();
    108       }
    109     }
    110 
    111     private void CalculateReplacementNodes() {
    112       ISymbolicExpressionTreeInterpreter interpreter = Content.Model.Interpreter;
    113       IEnumerable<int> trainingSamples = Enumerable.Range(Content.ProblemData.TrainingSamplesStart.Value, Content.ProblemData.TrainingSamplesEnd.Value - Content.ProblemData.TrainingSamplesStart.Value);
    114       SymbolicExpressionTreeNode root = new ProgramRootSymbol().CreateTreeNode();
    115       SymbolicExpressionTreeNode start = new StartSymbol().CreateTreeNode();
    116       root.AddSubTree(start);
    117       SymbolicExpressionTree tree = new SymbolicExpressionTree(root);
    118       foreach (SymbolicExpressionTreeNode node in this.simplifiedExpressionTree.IterateNodesPrefix()) {
    119         if (!(node.Symbol is ProgramRootSymbol || node.Symbol is StartSymbol)) {
    120           while (start.SubTrees.Count > 0) start.RemoveSubTree(0);
    121           start.AddSubTree(node);
    122           double constantTreeNodeValue = interpreter.GetSymbolicExpressionTreeValues(tree, Content.ProblemData.Dataset, trainingSamples).Median();
    123           ConstantTreeNode constantTreeNode = MakeConstantTreeNode(constantTreeNodeValue);
    124           replacementNodes[node] = constantTreeNode;
    125         }
    126       }
    127     }
    128 
    129     private void CalculateNodeImpacts(SymbolicExpressionTree tree, SymbolicExpressionTreeNode currentTreeNode, double originalTrainingMeanSquaredError) {
    130       foreach (SymbolicExpressionTreeNode childNode in currentTreeNode.SubTrees.ToList()) {
    131         SwitchNode(currentTreeNode, childNode, replacementNodes[childNode]);
    132         int samplesStart = Content.ProblemData.TrainingSamplesStart.Value;
    133         int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value;
    134         double newTrainingMeanSquaredError = SymbolicRegressionMeanSquaredErrorEvaluator.Calculate(
    135           Content.Model.Interpreter, tree,
    136           Content.LowerEstimationLimit, Content.UpperEstimationLimit,
    137           Content.ProblemData.Dataset, Content.ProblemData.TargetVariable.Value,
    138           Enumerable.Range(samplesStart, samplesEnd - samplesStart));
    139         nodeImpacts[childNode] = newTrainingMeanSquaredError / originalTrainingMeanSquaredError;
    140         SwitchNode(currentTreeNode, replacementNodes[childNode], childNode);
    141         CalculateNodeImpacts(tree, childNode, originalTrainingMeanSquaredError);
    142       }
    143     }
    144 
    145     private void SwitchNode(SymbolicExpressionTreeNode root, SymbolicExpressionTreeNode oldBranch, SymbolicExpressionTreeNode newBranch) {
    146       for (int i = 0; i < root.SubTrees.Count; i++) {
    147         if (root.SubTrees[i] == oldBranch) {
     90    private void SwitchNode(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode oldBranch, ISymbolicExpressionTreeNode newBranch) {
     91      for (int i = 0; i < root.SubTrees.Count(); i++) {
     92        if (root.GetSubTree(i) == oldBranch) {
    14893          root.RemoveSubTree(i);
    14994          root.InsertSubTree(i, newBranch);
     
    15297      }
    15398    }
    154 
    155     private ConstantTreeNode MakeConstantTreeNode(double value) {
    156       Constant constant = new Constant();
    157       constant.MinValue = value - 1;
    158       constant.MaxValue = value + 1;
    159       ConstantTreeNode constantTreeNode = (ConstantTreeNode)constant.CreateTreeNode();
    160       constantTreeNode.Value = value;
    161       return constantTreeNode;
    162     }
    163 
    164     private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) {
    165       VisualSymbolicExpressionTreeNode visualTreeNode = (VisualSymbolicExpressionTreeNode)sender;
    166       foreach (SymbolicExpressionTreeNode treeNode in simplifiedExpressionTree.IterateNodesPostfix()) {
    167         for (int i = 0; i < treeNode.SubTrees.Count; i++) {
    168           SymbolicExpressionTreeNode subTree = treeNode.SubTrees[i];
    169           if (subTree == visualTreeNode.SymbolicExpressionTreeNode) {
    170             ReplaceNodeWithConstant(treeNode, i);
    171           }
    172         }
    173       }
    174 
    175       // show only interesting part of solution
    176       this.treeChart.Tree = new SymbolicExpressionTree(simplifiedExpressionTree.Root.SubTrees[0].SubTrees[0]);
    177 
    178       SymbolicExpressionTree tree = (SymbolicExpressionTree)simplifiedExpressionTree.Clone();
    179 
    180       this.Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    181       this.Content.Model = new SymbolicRegressionModel(Content.Model.Interpreter, tree);
    182       this.Content.ModelChanged += new EventHandler(Content_ModelChanged);
    183 
    184       this.PaintNodeImpacts();
    185     }
    186 
    187     private void ReplaceNodeWithConstant(SymbolicExpressionTreeNode parent, int subTreeIndex) {
    188       SymbolicExpressionTreeNode subTree = parent.SubTrees[subTreeIndex];
    189       parent.RemoveSubTree(subTreeIndex);
    190       if (replacementNodes.ContainsKey(subTree))
    191         parent.InsertSubTree(subTreeIndex, replacementNodes[subTree]);
    192       else if (subTree is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)subTree))
    193         parent.InsertSubTree(subTreeIndex, replacementNodes.Where(v => v.Value == subTree).Single().Key);
    194       else if (!(subTree is ConstantTreeNode))
    195         throw new InvalidOperationException("Could not find replacement value.");
    196     }
    197 
    198     private void PaintNodeImpacts() {
    199       var impacts = nodeImpacts.Values;
    200       double max = impacts.Max();
    201       double min = impacts.Min();
    202       foreach (SymbolicExpressionTreeNode treeNode in simplifiedExpressionTree.IterateNodesPostfix()) {
    203         if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) {
    204           double impact = this.nodeImpacts[treeNode];
    205           double replacementValue = this.replacementNodes[treeNode].Value;
    206           VisualSymbolicExpressionTreeNode visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
    207 
    208           if (impact < 1.0) {
    209             visualTree.FillColor = Color.FromArgb((int)((1.0 - impact) * 255), Color.Red);
    210           } else {
    211             visualTree.FillColor = Color.FromArgb((int)((impact - 1.0) / max * 255), Color.Green);
    212           }
    213           visualTree.ToolTip += Environment.NewLine + "Node impact: " + impact;
    214           visualTree.ToolTip += Environment.NewLine + "Replacement value: " + replacementValue;
    215         }
    216       }
    217       this.PaintCollapsedNodes();
    218       this.treeChart.Repaint();
    219     }
    220 
    221     private void PaintCollapsedNodes() {
    222       foreach (SymbolicExpressionTreeNode treeNode in simplifiedExpressionTree.IterateNodesPostfix()) {
    223         if (treeNode is ConstantTreeNode && replacementNodes.ContainsValue((ConstantTreeNode)treeNode))
    224           this.treeChart.GetVisualSymbolicExpressionTreeNode(treeNode).LineColor = Color.DarkOrange;
    225         else {
    226           VisualSymbolicExpressionTreeNode visNode = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);
    227           if (visNode != null)
    228             visNode.LineColor = Color.Black;
    229         }
    230       }
    231     }
    232 
    233     private void btnSimplify_Click(object sender, EventArgs e) {
    234       this.CalculateReplacementNodesAndNodeImpacts();
    235     }
    23699  }
    237100}
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.Designer.cs

    r5692 r5699  
    2020#endregion
    2121
    22 namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
     22namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
    2323  partial class SymbolicRegressionSolutionView {
    2424    /// <summary>
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs

    r5692 r5699  
    2323using System.Windows.Forms;
    2424using HeuristicLab.MainForm;
    25 using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
     25using HeuristicLab.Problems.DataAnalysis.Views;
    2626
    27 namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic {
    28   [Content(typeof(SymbolicRegressionSolution))]
     27namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views {
     28  [Content(typeof(ISymbolicRegressionSolution))]
    2929  [View("Symbolic Regression Solution View")]
    3030  public partial class SymbolicRegressionSolutionView : DataAnalysisSolutionView {
     
    3333    }
    3434
    35     protected new SymbolicRegressionSolution Content {
    36       get { return (SymbolicRegressionSolution)base.Content; }
     35    protected new ISymbolicRegressionSolution Content {
     36      get { return (ISymbolicRegressionSolution)base.Content; }
    3737      set { base.Content = value; }
    3838    }
     
    4040    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    4141      InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView();
    42       view.Content = (SymbolicRegressionSolution)this.Content.Clone();
     42      view.Content = (ISymbolicRegressionSolution)this.Content.Clone();
    4343      view.Show();
    4444    }
Note: See TracChangeset for help on using the changeset viewer.