Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3915 for trunk/sources


Ignore:
Timestamp:
06/11/10 13:06:42 (15 years ago)
Author:
mkommend
Message:

implemented InteractiveSymbolicRegressionSolutionSimplifierView and fixed lots of minor bugs in the DataAnalysis and DataAnalysis.Views project (ticket #1010)

Location:
trunk/sources
Files:
4 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.3/SymbolicExpressionTreeChart.cs

    r3470 r3915  
    130130        }
    131131      }
     132    }
     133
     134    public VisualSymbolicExpressionTreeNode GetVisualSymbolicExpressionTreeNode(SymbolicExpressionTreeNode symbolicExpressionTreeNode) {
     135      if (visualTreeNodes.ContainsKey(symbolicExpressionTreeNode))
     136        return visualTreeNodes[symbolicExpressionTreeNode];
     137      return null;
    132138    }
    133139
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ContentView.cs

    r3904 r3915  
    4343      get { return content; }
    4444      set {
    45         if ((value != null) && (!MainFormManager.ViewCanViewContent(this, value)))
     45        //check if the ContentView is tagged with a corresponding ContentAttribute for the type of the Content
     46        if ((value != null) && (!MainFormManager.ViewCanViewContent(this, value)) &&
     47          ContentAttribute.HasContentAttribute(this.GetType()))
    4648          throw new ArgumentException(string.Format("View \"{0}\" cannot view object \"{1}\".", this.GetType().Name, value.GetType().Name));
    4749        if (InvokeRequired) {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/Analyzers/BestSymbolicRegressionSolutionAnalyzer.cs

    r3905 r3915  
    9797      if (BestSolutionQualityParameter.ActualValue == null || BestSolutionQualityParameter.ActualValue.Value > Quality[i].Value) {
    9898        var model = new SymbolicRegressionModel((ISymbolicExpressionTreeInterpreter)SymbolicExpressionTreeInterpreter.Clone(),
    99           SymbolicExpressionTree[i],
    100           GetInputVariables(SymbolicExpressionTree[i]));
     99          SymbolicExpressionTree[i]);
    101100        var solution = new SymbolicRegressionSolution(ProblemData, model, lowerEstimationLimit, upperEstimationLimit);
    102101
     
    134133    }
    135134
    136     private IEnumerable<string> GetInputVariables(SymbolicExpressionTree tree) {
    137       return (from varNode in tree.IterateNodesPrefix().OfType<VariableTreeNode>()
    138               select varNode.VariableName).Distinct();
    139     }
    140135  }
    141136}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionModel.cs

    r3884 r3915  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Drawing;
    2425using System.Linq;
    25 using System.Drawing;
    2626using HeuristicLab.Common;
    2727using HeuristicLab.Core;
    2828using HeuristicLab.Data;
     29using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     30using HeuristicLab.Operators;
    2931using HeuristicLab.Optimization;
    3032using HeuristicLab.Parameters;
    3133using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3234using HeuristicLab.PluginInfrastructure;
    33 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    3435using HeuristicLab.Problems.DataAnalysis;
    35 using HeuristicLab.Operators;
    3636using HeuristicLab.Problems.DataAnalysis.Symbolic;
     37using HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols;
    3738
    3839namespace HeuristicLab.Problems.DataAnalysis.Regression.Symbolic {
     
    4546      : base(deserializing) {
    4647    }
    47     public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree, IEnumerable<string> inputVariables)
     48    public SymbolicRegressionModel(ISymbolicExpressionTreeInterpreter interpreter, SymbolicExpressionTree tree)
    4849      : base() {
    4950      this.tree = tree;
    5051      this.interpreter = interpreter;
    51       this.inputVariables = inputVariables.ToList();
     52      this.inputVariables = tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(var => var.VariableName).Distinct().ToList();
    5253    }
    5354
     
    6667    public IEnumerable<string> InputVariables {
    6768      get { return inputVariables.AsEnumerable(); }
    68       set {
    69         if (value != null)
    70           inputVariables = new List<string>(value);
    71       }
    7269    }
    7370
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs

    r3904 r3915  
    5656    protected override void RegisterContentEvents() {
    5757      base.RegisterContentEvents();
     58      Content.ModelChanged += new EventHandler(Content_ModelChanged);
    5859      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    5960    }
     61
    6062    protected override void DeregisterContentEvents() {
    6163      base.DeregisterContentEvents();
     64      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    6265      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
     66    }
     67
     68    private void Content_ModelChanged(object sender, EventArgs e) {
     69      modelViewHost.Content = Content.Model;
    6370    }
    6471    private void Content_ProblemDataChanged(object sender, EventArgs e) {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj

    r3902 r3915  
    130130      <DependentUpon>ScatterPlotView.cs</DependentUpon>
    131131    </Compile>
     132    <Compile Include="Symbolic\InteractiveSymbolicRegressionSolutionSimplifierView.cs">
     133      <SubType>UserControl</SubType>
     134    </Compile>
     135    <Compile Include="Symbolic\InteractiveSymbolicRegressionSolutionSimplifierView.Designer.cs">
     136      <DependentUpon>InteractiveSymbolicRegressionSolutionSimplifierView.cs</DependentUpon>
     137    </Compile>
    132138    <Compile Include="Symbolic\SimplifiedSymbolicExpressionModelView.cs">
    133139      <SubType>UserControl</SubType>
     
    141147    <Compile Include="Symbolic\SymbolicExpressionModelView.designer.cs">
    142148      <DependentUpon>SymbolicExpressionModelView.cs</DependentUpon>
     149    </Compile>
     150    <Compile Include="Symbolic\SymbolicRegressionSolutionView.cs">
     151      <SubType>UserControl</SubType>
     152    </Compile>
     153    <Compile Include="Symbolic\SymbolicRegressionSolutionView.Designer.cs">
     154      <DependentUpon>SymbolicRegressionSolutionView.cs</DependentUpon>
    143155    </Compile>
    144156    <Compile Include="Symbolic\Symbols\ConstantView.cs">
     
    199211      <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    200212      <Name>HeuristicLab.Operators-3.3</Name>
     213    </ProjectReference>
     214    <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
     215      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
     216      <Name>HeuristicLab.Optimization-3.3</Name>
    201217    </ProjectReference>
    202218    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame

    r3651 r3915  
    3939  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3.0.0")]
    4040  [PluginDependency("HeuristicLab.Operators", "3.3.0.0")]
     41  [PluginDependency("HeuristicLab.Optimization", "3.3.0.0")]
    4142  [PluginDependency("HeuristicLab.Parameters", "3.3.0.0")]
    4243  [PluginDependency("HeuristicLab.Persistence", "3.3.0.0")]
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.Designer.cs

    r3908 r3915  
    2020#endregion
    2121
    22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Views {
     22namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
    2323  partial class ConstantView {
    2424    /// <summary>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/ConstantView.cs

    r3908 r3915  
    3535using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    3636
    37 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Views {
     37namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
    3838  [View("Constant View")]
    3939  [Content(typeof(Constant), true)]
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.Designer.cs

    r3908 r3915  
    2020#endregion
    2121
    22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Views {
     22namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
    2323  partial class VariableView {
    2424    /// <summary>
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/Symbols/VariableView.cs

    r3908 r3915  
    3535using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    3636
    37 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Views {
     37namespace HeuristicLab.Problems.DataAnalysis.Views.Symbolic.Symbols {
    3838  [View("Variable View")]
    3939  [Content(typeof(Variable), true)]
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/DataAnalysisSolution.cs

    r3884 r3915  
    6969          RegisterProblemDataEvents();
    7070          OnProblemDataChanged();
     71          RecalculateEstimatedValues();
    7172        }
    7273      }
     
    8283          model = value;
    8384          OnModelChanged();
     85          RecalculateEstimatedValues();
    8486        }
    8587      }
     
    128130    public event EventHandler ProblemDataChanged;
    129131    protected virtual void OnProblemDataChanged() {
    130       RecalculateEstimatedValues();
    131132      var listeners = ProblemDataChanged;
    132133      if (listeners != null)
     
    136137    public event EventHandler ModelChanged;
    137138    protected virtual void OnModelChanged() {
    138       RecalculateEstimatedValues();
    139139      EventHandler handler = ModelChanged;
    140140      if (handler != null)
Note: See TracChangeset for help on using the changeset viewer.