Free cookie consent management tool by TermsFeed Policy Generator

Changeset 9931


Ignore:
Timestamp:
09/03/13 15:46:01 (11 years ago)
Author:
ascheibe
Message:

#1730 merged r9587,r9590, r9600, r9607, r9626, r9658, r9659, r9699, r9906 into stable

Location:
stable
Files:
24 edited
3 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views

  • stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeChart.cs

    r9456 r9931  
    376376    }
    377377
    378     private void SaveImageAsBitmap(string filename) {
     378    public void SaveImageAsBitmap(string filename) {
    379379      if (tree == null) return;
    380380      Image image = new Bitmap(Width, Height);
     
    386386    }
    387387
    388     private void SaveImageAsEmf(string filename) {
     388    public void SaveImageAsEmf(string filename) {
    389389      if (tree == null) return;
    390390      using (Graphics g = CreateGraphics()) {
  • stable/HeuristicLab.ExtLibs

    • Property svn:mergeinfo set to (toggle deleted branches)
      /branches/ExportSymbolicDataAnalysisSolutions/HeuristicLab.ExtLibsmergedeligible
      /trunk/sources/HeuristicLab.ExtLibsmergedeligible
      /branches/Algorithms.GradientDescent/HeuristicLab.ExtLibs5516-5520
      /branches/Benchmarking/sources/HeuristicLab.ExtLibs6917-7005
      /branches/CloningRefactoring/HeuristicLab.ExtLibs4656-4721
      /branches/DataAnalysis Refactoring/HeuristicLab.ExtLibs5471-5808
      /branches/DataAnalysis SolutionEnsembles/HeuristicLab.ExtLibs5815-6180
      /branches/DataAnalysis/HeuristicLab.ExtLibs4458-4459,​4462,​4464
      /branches/GP.Grammar.Editor/HeuristicLab.ExtLibs6284-6795
      /branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.ExtLibs5060
      /branches/NET40/sources/HeuristicLab.ExtLibs5138-5162
      /branches/ParallelEngine/HeuristicLab.ExtLibs5175-5192
      /branches/ProblemInstancesRegressionAndClassification/HeuristicLab.ExtLibs7568-7810
      /branches/QAPAlgorithms/HeuristicLab.ExtLibs6350-6627
      /branches/Restructure trunk solution/HeuristicLab.ExtLibs6828
      /branches/RuntimeOptimizer/HeuristicLab.ExtLibs8943-9078
      /branches/ScatterSearch (trunk integration)/HeuristicLab.ExtLibs7787-8333
      /branches/SlaveShutdown/HeuristicLab.ExtLibs8944-8956
      /branches/SuccessProgressAnalysis/HeuristicLab.ExtLibs5370-5682
      /branches/Trunk/HeuristicLab.ExtLibs6829-6865
      /branches/UnloadJobs/HeuristicLab.ExtLibs9168-9215
      /branches/VNS/HeuristicLab.ExtLibs5594-5752
      /branches/histogram/HeuristicLab.ExtLibs5959-6341
  • stable/HeuristicLab.ExtLibs.sln

    r9856 r9931  
    4040EndProject
    4141Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.ALGLIB-3.7.0", "HeuristicLab.ExtLibs\HeuristicLab.ALGLIB\3.7.0\HeuristicLab.ALGLIB-3.7.0\HeuristicLab.ALGLIB-3.7.0.csproj", "{6F1D7847-D610-4E52-A184-405DAEFA41A9}"
     42EndProject
     43Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EPPlus-3.1.3", "HeuristicLab.ExtLibs\HeuristicLab.EPPlus\3.1.3\EPPlus-3.1.3\EPPlus-3.1.3.csproj", "{7B288026-5502-4A39-BF41-77E086F3E4A3}"
     44EndProject
     45Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.EPPlus-3.1.3", "HeuristicLab.ExtLibs\HeuristicLab.EPPlus\3.1.3\HeuristicLab.EPPlus-3.1.3\HeuristicLab.EPPlus-3.1.3.csproj", "{B8B9E73B-18DE-4781-8F31-D3472BA9DB66}"
    4246EndProject
    4347Global
     
    255259    {6F1D7847-D610-4E52-A184-405DAEFA41A9}.Release|x86.ActiveCfg = Release|x86
    256260    {6F1D7847-D610-4E52-A184-405DAEFA41A9}.Release|x86.Build.0 = Release|x86
     261    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     262    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
     263    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Debug|x64.ActiveCfg = Debug|x64
     264    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Debug|x64.Build.0 = Debug|x64
     265    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Debug|x86.ActiveCfg = Debug|x86
     266    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Debug|x86.Build.0 = Debug|x86
     267    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
     268    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Release|Any CPU.Build.0 = Release|Any CPU
     269    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Release|x64.ActiveCfg = Release|x64
     270    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Release|x64.Build.0 = Release|x64
     271    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Release|x86.ActiveCfg = Release|x86
     272    {7B288026-5502-4A39-BF41-77E086F3E4A3}.Release|x86.Build.0 = Release|x86
     273    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     274    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Debug|Any CPU.Build.0 = Debug|Any CPU
     275    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Debug|x64.ActiveCfg = Debug|x64
     276    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Debug|x64.Build.0 = Debug|x64
     277    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Debug|x86.ActiveCfg = Debug|x86
     278    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Debug|x86.Build.0 = Debug|x86
     279    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Release|Any CPU.ActiveCfg = Release|Any CPU
     280    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Release|Any CPU.Build.0 = Release|Any CPU
     281    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Release|x64.ActiveCfg = Release|x64
     282    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Release|x64.Build.0 = Release|x64
     283    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Release|x86.ActiveCfg = Release|x86
     284    {B8B9E73B-18DE-4781-8F31-D3472BA9DB66}.Release|x86.Build.0 = Release|x86
    257285  EndGlobalSection
    258286  GlobalSection(SolutionProperties) = preSolution
  • stable/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/EPPlus-3.1.3.csproj

    r9587 r9931  
    4848    <DebugType>full</DebugType>
    4949    <Optimize>false</Optimize>
    50     <OutputPath>..\..\..\..\..\..\trunk\sources\bin\</OutputPath>
     50    <OutputPath>$(SolutionDir)\bin\</OutputPath>
    5151    <DefineConstants>DEBUG;TRACE</DefineConstants>
    5252    <ErrorReport>prompt</ErrorReport>
     
    5959    <DebugType>pdbonly</DebugType>
    6060    <Optimize>true</Optimize>
    61     <OutputPath>..\..\..\..\..\..\trunk\sources\bin\</OutputPath>
     61    <OutputPath>$(SolutionDir)\bin\</OutputPath>
    6262    <DefineConstants>TRACE</DefineConstants>
    6363    <ErrorReport>prompt</ErrorReport>
     
    7070  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
    7171    <DebugSymbols>true</DebugSymbols>
    72     <OutputPath>..\..\..\..\bin\</OutputPath>
     72    <OutputPath>$(SolutionDir)\bin\</OutputPath>
    7373    <DefineConstants>DEBUG;TRACE</DefineConstants>
    7474    <DocumentationFile>
     
    8080  </PropertyGroup>
    8181  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
    82     <OutputPath>..\..\..\..\bin\</OutputPath>
     82    <OutputPath>$(SolutionDir)\bin\</OutputPath>
    8383    <DefineConstants>TRACE</DefineConstants>
    8484    <DocumentationFile>
     
    9292  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
    9393    <DebugSymbols>true</DebugSymbols>
    94     <OutputPath>..\..\..\..\bin\</OutputPath>
     94    <OutputPath>$(SolutionDir)\bin\</OutputPath>
    9595    <DefineConstants>DEBUG;TRACE</DefineConstants>
    9696    <DocumentationFile>
     
    102102  </PropertyGroup>
    103103  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
    104     <OutputPath>..\..\..\..\bin\</OutputPath>
     104    <OutputPath>$(SolutionDir)\bin\</OutputPath>
    105105    <DefineConstants>TRACE</DefineConstants>
    106106    <DocumentationFile>
     
    167167    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithStdDev.cs" />
    168168    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithText.cs" />
    169     <Compile Include="ConditionalFormatting\ExcelConditionalFormattingIconDataBarValue.cs" />
     169    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingIconDatabarValue.cs" />
    170170    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingDataBar.cs" />
    171171    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingFiveIconSet.cs" />
     
    321321    <Compile Include="VBA\ExcelVbaModule.cs" />
    322322    <Compile Include="VBA\ExcelVbaModuleAttribute.cs" />
    323     <Compile Include="VBA\ExcelVbaModuleCollection.cs" />
    324     <Compile Include="VBA\ExcelVbaProject.cs" />
     323    <Compile Include="VBA\ExcelVBAModuleCollection.cs" />
     324    <Compile Include="VBA\ExcelVBAProject.cs" />
    325325    <Compile Include="ExcelWorkbookView.cs" />
    326326    <Compile Include="ExcelWorksheetView.cs" />
     
    372372    <Compile Include="Utils\SqRefUtility.cs" />
    373373    <Compile Include="VBA\ExcelVbaProtection.cs" />
    374     <Compile Include="VBA\ExcelVbaReference.cs" />
    375     <Compile Include="VBA\ExcelVbaSignature.cs" />
     374    <Compile Include="VBA\ExcelVBAReference.cs" />
     375    <Compile Include="VBA\ExcelVBASignature.cs" />
    376376    <Compile Include="XmlHelper.cs" />
    377377    <Compile Include="XmlHelperFactory.cs" />
  • stable/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/HeuristicLab.EPPlus-3.1.3.csproj

    r9587 r9931  
    1818    <DebugType>full</DebugType>
    1919    <Optimize>false</Optimize>
    20     <OutputPath>..\..\..\..\..\..\trunk\sources\bin\</OutputPath>
     20    <OutputPath>..\..\..\..\bin\</OutputPath>
    2121    <DefineConstants>DEBUG;TRACE</DefineConstants>
    2222    <ErrorReport>prompt</ErrorReport>
     
    2626    <DebugType>pdbonly</DebugType>
    2727    <Optimize>true</Optimize>
    28     <OutputPath>..\..\..\..\..\..\trunk\sources\bin\</OutputPath>
     28    <OutputPath>..\..\..\..\bin\</OutputPath>
    2929    <DefineConstants>TRACE</DefineConstants>
    3030    <ErrorReport>prompt</ErrorReport>
     
    9292      <Project>{94186a6a-5176-4402-ae83-886557b53cca}</Project>
    9393      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
     94      <Private>False</Private>
    9495    </ProjectReference>
    9596    <ProjectReference Include="..\EPPlus-3.1.3\EPPlus-3.1.3.csproj">
     
    105106  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    106107  <PropertyGroup>
    107     <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     108    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    108109set ProjectDir=$(ProjectDir)
    109110set SolutionDir=$(SolutionDir)
    110111set Outdir=$(Outdir)
    111112
    112 call PreBuildEvent.cmd</PreBuildEvent>
     113call PreBuildEvent.cmd
     114</PreBuildEvent>
     115    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     116export ProjectDir=$(ProjectDir)
     117export SolutionDir=$(SolutionDir)
     118
     119$SolutionDir/PreBuildEvent.sh
     120</PreBuildEvent>
    113121  </PropertyGroup>
    114122  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • stable/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ControlExtensions.cs

    r9456 r9931  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Runtime.InteropServices;
    2425using System.Windows.Forms;
     
    4546      }
    4647    }
     48
     49    public static IEnumerable<Control> GetNestedControls(this Control control, Func<Control, bool> condition = null) {
     50      if (control == null) yield break;
     51      if (condition == null) condition = (c) => true;
     52
     53      Queue<Control> unprocessed = new Queue<Control>();
     54      unprocessed.Enqueue(control);
     55
     56      while (unprocessed.Count > 0) {
     57        Control c = unprocessed.Dequeue();
     58        if (condition(c)) yield return c;
     59        foreach (Control child in c.Controls)
     60          unprocessed.Enqueue(child);
     61      }
     62    }
    4763  }
    4864}
  • stable/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r9456 r9931  
    386386      ToolStripMenuItem item = new ToolStripMenuItem();
    387387      this.SetToolStripItemProperties(item, menuItem);
     388      this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), item, menuStrip.Items);
    388389      if (menuItem is MenuItem) {
    389390        MenuItem menuItemBase = (MenuItem)menuItem;
     
    392393        item.DisplayStyle = menuItemBase.ToolStripItemDisplayStyle;
    393394      }
    394       this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), item, menuStrip.Items);
    395395    }
    396396
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/Interfaces/ISymbolicClassificationModel.cs

    r9456 r9931  
    2323namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification {
    2424  public interface ISymbolicClassificationModel : IClassificationModel, ISymbolicDataAnalysisModel {
    25     double LowerEstimationLimit { get; }
    26     double UpperEstimationLimit { get; }
    2725    void RecalculateModelParameters(IClassificationProblemData problemData, IEnumerable<int> rows);
    2826    new ISymbolicClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData);
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationModel.cs

    r9456 r9931  
    3232  [StorableClass]
    3333  [Item(Name = "SymbolicClassificationModel", Description = "Represents a symbolic classification model.")]
    34   public abstract class
    35     SymbolicClassificationModel : SymbolicDataAnalysisModel, ISymbolicClassificationModel {
    36     [Storable]
    37     private double lowerEstimationLimit;
    38     public double LowerEstimationLimit { get { return lowerEstimationLimit; } }
    39     [Storable]
    40     private double upperEstimationLimit;
    41     public double UpperEstimationLimit { get { return upperEstimationLimit; } }
     34  public abstract class SymbolicClassificationModel : SymbolicDataAnalysisModel, ISymbolicClassificationModel {
    4235
    4336    [StorableConstructor]
    4437    protected SymbolicClassificationModel(bool deserializing) : base(deserializing) { }
    45     protected SymbolicClassificationModel(SymbolicClassificationModel original, Cloner cloner)
    46       : base(original, cloner) {
    47       lowerEstimationLimit = original.lowerEstimationLimit;
    48       upperEstimationLimit = original.upperEstimationLimit;
    49     }
    50     protected SymbolicClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue)
    51       : base(tree, interpreter) {
    52       this.lowerEstimationLimit = lowerEstimationLimit;
    53       this.upperEstimationLimit = upperEstimationLimit;
    54     }
     38    protected SymbolicClassificationModel(SymbolicClassificationModel original, Cloner cloner) : base(original, cloner) { }
     39    protected SymbolicClassificationModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
     40      double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue)
     41      : base(tree, interpreter, lowerEstimationLimit, upperEstimationLimit) { }
    5542
    5643    public abstract IEnumerable<double> GetEstimatedClassValues(Dataset dataset, IEnumerable<int> rows);
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/Interfaces/ISymbolicRegressionModel.cs

    r9456 r9931  
    2222namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    2323  public interface ISymbolicRegressionModel : IRegressionModel, ISymbolicDataAnalysisModel {
    24     double LowerEstimationLimit { get; }
    25     double UpperEstimationLimit { get; }
    26 
    2724    void Scale(IRegressionProblemData problemData);
    2825  }
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionModel.cs

    r9456 r9931  
    3333  [Item(Name = "Symbolic Regression Model", Description = "Represents a symbolic regression model.")]
    3434  public class SymbolicRegressionModel : SymbolicDataAnalysisModel, ISymbolicRegressionModel {
    35     [Storable]
    36     private double lowerEstimationLimit;
    37     public double LowerEstimationLimit { get { return lowerEstimationLimit; } }
    38     [Storable]
    39     private double upperEstimationLimit;
    40     public double UpperEstimationLimit { get { return upperEstimationLimit; } }
     35
    4136
    4237    [StorableConstructor]
    4338    protected SymbolicRegressionModel(bool deserializing) : base(deserializing) { }
    44     protected SymbolicRegressionModel(SymbolicRegressionModel original, Cloner cloner)
    45       : base(original, cloner) {
    46       this.lowerEstimationLimit = original.lowerEstimationLimit;
    47       this.upperEstimationLimit = original.upperEstimationLimit;
    48     }
     39    protected SymbolicRegressionModel(SymbolicRegressionModel original, Cloner cloner) : base(original, cloner) { }
     40
    4941    public SymbolicRegressionModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
    5042      double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue)
    51       : base(tree, interpreter) {
    52       this.lowerEstimationLimit = lowerEstimationLimit;
    53       this.upperEstimationLimit = upperEstimationLimit;
    54     }
     43      : base(tree, interpreter, lowerEstimationLimit, upperEstimationLimit) { }
    5544
    5645    public override IDeepCloneable Clone(Cloner cloner) {
     
    6049    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
    6150      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows)
    62         .LimitToRange(lowerEstimationLimit, upperEstimationLimit);
     51        .LimitToRange(LowerEstimationLimit, UpperEstimationLimit);
    6352    }
    6453
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/Interfaces/ISymbolicTimeSeriesPrognosisModel.cs

    r9462 r9931  
    2323  public interface ISymbolicTimeSeriesPrognosisModel : ITimeSeriesPrognosisModel, ISymbolicDataAnalysisModel {
    2424    new ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter Interpreter { get; }
    25     double LowerEstimationLimit { get; }
    26     double UpperEstimationLimit { get; }
    2725  }
    2826}
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r9288 r9931  
    9797      <Private>False</Private>
    9898    </Reference>
     99    <Reference Include="EPPlus-3.1.3, Version=3.1.3.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
     100      <SpecificVersion>False</SpecificVersion>
     101      <HintPath>..\..\bin\EPPlus-3.1.3.dll</HintPath>
     102      <Private>False</Private>
     103    </Reference>
    99104    <Reference Include="System" />
    100105    <Reference Include="System.Core">
     
    126131      <DependentUpon>MathSymbolicDataAnalysisModelView.cs</DependentUpon>
    127132    </Compile>
     133    <Compile Include="MenuItems\ExportSymbolicSolutionToExcelMenuItem.cs" />
    128134    <Compile Include="Plugin.cs" />
    129135    <Compile Include="TextualSymbolicDataAnalysisModelView.cs">
     
    274280      <Name>HeuristicLab.Optimization-3.3</Name>
    275281      <Private>False</Private>
     282    </ProjectReference>
     283    <ProjectReference Include="..\..\HeuristicLab.Optimizer\3.3\HeuristicLab.Optimizer-3.3.csproj">
     284      <Project>{c664305e-497c-4533-a140-967dedb05c19}</Project>
     285      <Name>HeuristicLab.Optimizer-3.3</Name>
    276286    </ProjectReference>
    277287    <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/MenuItems/ExportSymbolicSolutionToExcelMenuItem.cs

    r9587 r9931  
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.IO;
    2526using System.Linq;
     
    2728using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
    2829using HeuristicLab.MainForm;
     30using HeuristicLab.MainForm.WindowsForms;
    2931using HeuristicLab.Optimizer;
    3032using OfficeOpenXml;
     
    5254
    5355    protected override void OnToolStripItemSet(EventArgs e) {
     56      base.OnToolStripItemSet(e);
    5457      ToolStripItem.Enabled = false;
    55     }
    56     protected override void OnActiveViewChanged(object sender, EventArgs e) {
     58      var menuItem = ToolStripItem.OwnerItem as ToolStripMenuItem;
     59      if (menuItem != null)
     60        menuItem.DropDownOpening += menuItem_DropDownOpening;
     61    }
     62
     63    private void menuItem_DropDownOpening(object sender, EventArgs e) {
    5764      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
    58       ToolStripItem.Enabled = activeView != null && activeView.Content is ISymbolicDataAnalysisSolution;
     65      Control control = activeView as Control;
     66      activeView = control.GetNestedControls((c) => c.Visible)
     67        .OfType<IContentView>().FirstOrDefault(v => v.Content is ISymbolicDataAnalysisSolution && v.Content is IRegressionSolution);
     68      ToolStripItem.Enabled = activeView != null;
    5969    }
    6070
    6171    public override void Execute() {
    62       var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
     72      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
     73      Control control = activeView as Control;
     74      activeView = control.GetNestedControls((c) => c.Visible)
     75        .OfType<IContentView>().First(v => v.Content is ISymbolicDataAnalysisSolution && v.Content is IRegressionSolution);
    6376      var solution = (ISymbolicDataAnalysisSolution)activeView.Content;
    6477      var formatter = new SymbolicDataAnalysisExpressionExcelFormatter();
    65       var formula = formatter.Format(solution.Model.SymbolicExpressionTree);
    66       var formulaParts = formula.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
     78      var formula = formatter.Format(solution.Model.SymbolicExpressionTree, solution.ProblemData.Dataset);
     79      control = (Control)activeView;
     80
    6781
    6882      SaveFileDialog saveFileDialog = new SaveFileDialog();
     
    7185      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
    7286        string fileName = saveFileDialog.FileName;
    73         FileInfo newFile = new FileInfo(fileName);
    74         if (newFile.Exists) {
    75           newFile.Delete();
    76           newFile = new FileInfo(fileName);
     87        using (BackgroundWorker bg = new BackgroundWorker()) {
     88          MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(control, "Exportion solution to " + fileName + ".");
     89          bg.DoWork += (b, e) => ExportChart(fileName, solution, formula);
     90          bg.RunWorkerCompleted += (o, e) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(control);
     91          bg.RunWorkerAsync();
    7792        }
    78         using (ExcelPackage package = new ExcelPackage(newFile)) {
    79           ExcelWorksheet modelWorksheet = package.Workbook.Worksheets.Add("Model");
    80           FormatModelSheet(modelWorksheet, solution, formulaParts);
    81 
    82           ExcelWorksheet datasetWorksheet = package.Workbook.Worksheets.Add("Dataset");
    83           WriteDatasetToExcel(datasetWorksheet, solution.ProblemData);
    84 
    85           ExcelWorksheet inputsWorksheet = package.Workbook.Worksheets.Add("Inputs");
    86           WriteInputSheet(inputsWorksheet, datasetWorksheet, formulaParts.Skip(2), solution.ProblemData.Dataset);
    87 
    88           if (solution is IRegressionSolution) {
    89             ExcelWorksheet estimatedWorksheet = package.Workbook.Worksheets.Add("Estimated Values");
    90             WriteEstimatedWorksheet(estimatedWorksheet, datasetWorksheet, formulaParts, solution as IRegressionSolution);
    91 
    92             ExcelWorksheet chartsWorksheet = package.Workbook.Worksheets.Add("Charts");
    93             AddCharts(chartsWorksheet);
    94           }
    95           package.Workbook.Properties.Title = "Excel Export";
    96           package.Workbook.Properties.Author = "HEAL";
    97           package.Workbook.Properties.Comments = "Excel export of a symbolic data analysis solution from HeuristicLab";
    98 
    99           package.Save();
     93      }
     94    }
     95
     96    private void ExportChart(string fileName, ISymbolicDataAnalysisSolution solution, string formula) {
     97      FileInfo newFile = new FileInfo(fileName);
     98      if (newFile.Exists) {
     99        newFile.Delete();
     100        newFile = new FileInfo(fileName);
     101      }
     102      var formulaParts = formula.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
     103
     104      using (ExcelPackage package = new ExcelPackage(newFile)) {
     105        ExcelWorksheet modelWorksheet = package.Workbook.Worksheets.Add("Model");
     106        FormatModelSheet(modelWorksheet, solution, formulaParts);
     107
     108        ExcelWorksheet datasetWorksheet = package.Workbook.Worksheets.Add("Dataset");
     109        WriteDatasetToExcel(datasetWorksheet, solution.ProblemData);
     110
     111        ExcelWorksheet inputsWorksheet = package.Workbook.Worksheets.Add("Inputs");
     112        WriteInputSheet(inputsWorksheet, datasetWorksheet, formulaParts.Skip(2), solution.ProblemData.Dataset);
     113
     114        if (solution is IRegressionSolution) {
     115          ExcelWorksheet estimatedWorksheet = package.Workbook.Worksheets.Add("Estimated Values");
     116          WriteEstimatedWorksheet(estimatedWorksheet, datasetWorksheet, formulaParts, solution as IRegressionSolution);
     117
     118          ExcelWorksheet chartsWorksheet = package.Workbook.Worksheets.Add("Charts");
     119          AddCharts(chartsWorksheet);
    100120        }
     121        package.Workbook.Properties.Title = "Excel Export";
     122        package.Workbook.Properties.Author = "HEAL";
     123        package.Workbook.Properties.Comments = "Excel export of a symbolic data analysis solution from HeuristicLab";
     124
     125        package.Save();
    101126      }
    102127    }
     
    124149      modelWorksheet.Cells[row, 2].Value = solution.Model.LowerEstimationLimit;
    125150      modelWorksheet.Names.Add("EstimationLimitLower", modelWorksheet.Cells[row, 2]);
     151      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    126152      row++;
    127153
     
    129155      modelWorksheet.Cells[row, 2].Value = solution.Model.UpperEstimationLimit;
    130156      modelWorksheet.Names.Add("EstimationLimitUpper", modelWorksheet.Cells[row, 2]);
     157      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    131158      row += 2;
    132159
     
    167194      modelWorksheet.Cells[row, 1].Value = "Pearson's R² (training)";
    168195      modelWorksheet.Cells[row, 2].Formula = string.Format("POWER(PEARSON({0},{1}),2)", excelTrainingTarget, excelTrainingEstimated);
     196      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    169197      row++;
    170198
    171199      modelWorksheet.Cells[row, 1].Value = "Pearson's R² (test)";
    172200      modelWorksheet.Cells[row, 2].Formula = string.Format("POWER(PEARSON({0},{1}),2)", excelTestTarget, excelTestEstimated);
     201      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    173202      row++;
    174203
     
    176205      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingMSE);
    177206      modelWorksheet.Names.Add("TrainingMSE", modelWorksheet.Cells[row, 2]);
     207      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    178208      row++;
    179209
     
    181211      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestMSE);
    182212      modelWorksheet.Names.Add("TestMSE", modelWorksheet.Cells[row, 2]);
     213      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    183214      row++;
    184215
    185216      modelWorksheet.Cells[row, 1].Value = "Mean absolute error (training)";
    186217      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingAbsoluteError);
     218      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    187219      row++;
    188220
    189221      modelWorksheet.Cells[row, 1].Value = "Mean absolute error (test)";
    190222      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestAbsoluteError);
     223      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    191224      row++;
    192225
    193226      modelWorksheet.Cells[row, 1].Value = "Mean error (training)";
    194227      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTrainingMeanError);
     228      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    195229      row++;
    196230
    197231      modelWorksheet.Cells[row, 1].Value = "Mean error (test)";
    198232      modelWorksheet.Cells[row, 2].Formula = string.Format("AVERAGE({0})", excelTestMeanError);
     233      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    199234      row++;
    200235
     
    211246      modelWorksheet.Cells[row, 1].Value = "Normalized Mean Squared error (training)";
    212247      modelWorksheet.Cells[row, 2].Formula = string.Format("TrainingMSE / VAR({0})", excelTrainingTarget);
     248      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    213249      row++;
    214250
    215251      modelWorksheet.Cells[row, 1].Value = "Normalized Mean Squared error  (test)";
    216252      modelWorksheet.Cells[row, 2].Formula = string.Format("TestMSE / VAR({0})", excelTestTarget);
     253      modelWorksheet.Cells[row, 2].Style.Numberformat.Format = "0.000";
    217254
    218255      modelWorksheet.Cells["A1:B" + row].AutoFitColumns();
     
    300337        estimatedWorksheet.Cells[i + 2, 9].Formula = string.Format(preparedFormula, i + 2);
    301338      }
     339      estimatedWorksheet.Cells["B2:B" + (rows + 1)].Style.Numberformat.Format = "0.000";
    302340
    303341      estimatedWorksheet.Cells["C2:C" + (rows + 1)].Formula = "J2";
    304 
     342      estimatedWorksheet.Cells["C2:C" + (rows + 1)].Style.Numberformat.Format = "0.000";
    305343      estimatedWorksheet.Cells["D2:D" + (rows + 1)].Formula = "ABS(B2 - C2)";
    306       estimatedWorksheet.Cells["E2:E" + (rows + 1)].Formula = "D2 / B2";
     344      estimatedWorksheet.Cells["D2:D" + (rows + 1)].Style.Numberformat.Format = "0.000";
     345      estimatedWorksheet.Cells["E2:E" + (rows + 1)].Formula = "ABS(D2 / B2)";
     346      estimatedWorksheet.Cells["E2:E" + (rows + 1)].Style.Numberformat.Format = "0.000";
    307347      estimatedWorksheet.Cells["F2:F" + (rows + 1)].Formula = "C2 - B2";
     348      estimatedWorksheet.Cells["F2:F" + (rows + 1)].Style.Numberformat.Format = "0.000";
    308349      estimatedWorksheet.Cells["G2:G" + (rows + 1)].Formula = "POWER(F2, 2)";
    309 
     350      estimatedWorksheet.Cells["G2:G" + (rows + 1)].Style.Numberformat.Format = "0.000";
     351
     352      estimatedWorksheet.Cells["I2:I" + (rows + 1)].Style.Numberformat.Format = "0.000";
    310353      estimatedWorksheet.Cells["J2:J" + (rows + 1)].Formula = "IFERROR(IF(I2 > Model!EstimationLimitUpper, Model!EstimationLimitUpper, IF(I2 < Model!EstimationLimitLower, Model!EstimationLimitLower, I2)), AVERAGE(Model!EstimationLimitLower, Model!EstimationLimitUpper))";
     354      estimatedWorksheet.Cells["J2:J" + (rows + 1)].Style.Numberformat.Format = "0.000";
    311355    }
    312356
     
    322366
    323367    private void WriteInputSheet(ExcelWorksheet inputsWorksheet, ExcelWorksheet datasetWorksheet, IEnumerable<string> list, Dataset dataset) {
    324       int rows = dataset.Rows;
    325       var variableNames = dataset.VariableNames.ToList();
    326       int cur = 1;
    327       foreach (var variableMapping in list) {
    328         var varMap = variableMapping.Split(new string[] { " = " }, StringSplitOptions.None);
    329         if (varMap.Count() != 2) throw new ArgumentException("variableMapping is not correct");
    330         int column = variableNames.FindIndex(x => x.Equals(varMap[0])) + 1;
    331         inputsWorksheet.Cells[1, cur].Value = varMap[0];
    332         for (int i = 2; i <= rows + 1; i++) {
    333           inputsWorksheet.Cells[i, cur].Formula = datasetWorksheet.Cells[i, column].FullAddress;
     368      //remark the performance of EPPlus drops dramatically
     369      //if the data is not written row wise (from left to right) due the internal indices used.
     370      var variableNames = dataset.VariableNames.Select((v, i) => new { variable = v, index = i + 1 }).ToDictionary(v => v.variable, v => v.index);
     371      var nameMapping = list.Select(x => x.Split('=')[0].Trim()).ToArray();
     372
     373      for (int row = 1; row <= dataset.Rows + 1; row++) {
     374        for (int column = 1; column < nameMapping.Length + 1; column++) {
     375          int variableIndex = variableNames[nameMapping[column - 1]];
     376          inputsWorksheet.Cells[row, column].Formula = datasetWorksheet.Cells[row, variableIndex].FullAddress;
    334377        }
    335         cur++;
    336378      }
    337379    }
    338380
    339381    private void WriteDatasetToExcel(ExcelWorksheet datasetWorksheet, IDataAnalysisProblemData problemData) {
     382      //remark the performance of EPPlus drops dramatically
     383      //if the data is not written row wise (from left to right) due the internal indices used.
    340384      Dataset dataset = problemData.Dataset;
    341385      var variableNames = dataset.VariableNames.ToList();
    342       for (int col = 1; col <= variableNames.Count; col++) {
     386      var doubleVariables = new HashSet<string>(dataset.DoubleVariables);
     387
     388      for (int col = 1; col <= variableNames.Count; col++)
    343389        datasetWorksheet.Cells[1, col].Value = variableNames[col - 1];
    344         if (dataset.DoubleVariables.Contains(variableNames[col - 1])) {
    345           datasetWorksheet.Cells[2, col].LoadFromCollection(dataset.GetDoubleValues(variableNames[col - 1]));
    346         } else {
    347           var coll = Enumerable.Range(0, dataset.Rows).Select(x => dataset.GetValue(x, col - 1));
    348           datasetWorksheet.Cells[2, col].LoadFromCollection(coll);
     390
     391      for (int row = 0; row < dataset.Rows; row++) {
     392        for (int col = 0; col < variableNames.Count; col++) {
     393          if (doubleVariables.Contains(variableNames[col]))
     394            datasetWorksheet.Cells[row + 2, col + 1].Value = dataset.GetDoubleValue(variableNames[col], row);
     395          else
     396            datasetWorksheet.Cells[row + 2, col + 1].Value = dataset.GetValue(row, col);
    349397        }
    350398      }
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame

    r9462 r9931  
    3636  [PluginDependency("HeuristicLab.Data", "3.3")]
    3737  [PluginDependency("HeuristicLab.Data.Views", "3.3")]
     38  [PluginDependency("HeuristicLab.EPPlus", "3.1")]
    3839  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
    3940  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.4")]
     
    4243  [PluginDependency("HeuristicLab.MathJax", "1.1")]
    4344  [PluginDependency("HeuristicLab.Optimization","3.3")]
     45  [PluginDependency("HeuristicLab.Optimizer","3.3")]
    4446  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
    4547  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicDataAnalysisExpressionExcelFormatter.cs

    r9587 r9931  
    2323using System.Collections.Generic;
    2424using System.Globalization;
     25using System.Linq;
    2526using System.Text;
    2627using HeuristicLab.Common;
     
    6667      return string.Format("${0}1", variableNameMapping[variabelName]);
    6768    }
    68 
    6969    public string Format(ISymbolicExpressionTree symbolicExpressionTree) {
     70      return Format(symbolicExpressionTree, null);
     71    }
     72
     73    public string Format(ISymbolicExpressionTree symbolicExpressionTree, Dataset dataset) {
    7074      var stringBuilder = new StringBuilder();
     75      if (dataset != null) CalculateVariableMapping(symbolicExpressionTree, dataset);
     76
    7177      stringBuilder.Append("=");
    7278      stringBuilder.Append(FormatRecursively(symbolicExpressionTree.Root));
     79
    7380      foreach (var variable in variableNameMapping) {
    7481        stringBuilder.AppendLine();
     
    7683      }
    7784      return stringBuilder.ToString();
     85    }
     86
     87    private void CalculateVariableMapping(ISymbolicExpressionTree tree, Dataset dataset) {
     88      int columnIndex = 0;
     89      int inputIndex = 0;
     90      var usedVariables = tree.IterateNodesPrefix().OfType<VariableTreeNode>().Select(v => v.VariableName).Distinct();
     91      foreach (var variable in dataset.VariableNames) {
     92        columnIndex++;
     93        if (!usedVariables.Contains(variable)) continue;
     94        inputIndex++;
     95        variableNameMapping[variable] = GetExcelColumnName(inputIndex);
     96      }
    7897    }
    7998
     
    137156        stringBuilder.Append(")");
    138157      } else if (symbol is Logarithm) {
    139         stringBuilder.Append("LOG(");
    140         stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
    141         stringBuilder.Append(", EXP(1))"); // Excel does not use the natural logarithm, therefor the base has to be set
     158        stringBuilder.Append("LN(");
     159        stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
     160        stringBuilder.Append(")");
    142161      } else if (symbol is Multiplication) {
    143162        for (int i = 0; i < node.SubtreeCount; i++) {
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r9862 r9931  
    139139    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionProbabilisticFunctionalCrossover.cs" />
    140140    <Compile Include="Crossovers\SymbolicDataAnalysisExpressionSemanticSimilarityCrossover.cs" />
    141     <Compile Include="Formatters\SymbolicDataAnalysisExpressionSmalltalkFormatter.cs" />
     141    <Compile Include="Formatters\SymbolicDataAnalysisExpressionExcelFormatter.cs" />
     142  <Compile Include="Formatters\SymbolicDataAnalysisExpressionSmalltalkFormatter.cs" />
    142143    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionCrossover.cs" />
    143144    <Compile Include="Interfaces\ISymbolicDataAnalysisImpactValuesCalculator.cs" />
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/ISymbolicDataAnalysisModel.cs

    r9456 r9931  
    2525    ISymbolicExpressionTree SymbolicExpressionTree { get; }
    2626    ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get; }
     27
     28    double LowerEstimationLimit { get; }
     29    double UpperEstimationLimit { get; }
    2730  }
    2831}
  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisModel.cs

    r9456 r9931  
    3838
    3939    #region properties
     40    [Storable]
     41    private double lowerEstimationLimit;
     42    public double LowerEstimationLimit { get { return lowerEstimationLimit; } }
     43    [Storable]
     44    private double upperEstimationLimit;
     45    public double UpperEstimationLimit { get { return upperEstimationLimit; } }
    4046
    4147    [Storable]
     
    5056      get { return interpreter; }
    5157    }
    52 
    5358    #endregion
    5459
     
    5964      this.symbolicExpressionTree = cloner.Clone(original.symbolicExpressionTree);
    6065      this.interpreter = cloner.Clone(original.interpreter);
     66      this.lowerEstimationLimit = original.lowerEstimationLimit;
     67      this.upperEstimationLimit = original.upperEstimationLimit;
    6168    }
    62     public SymbolicDataAnalysisModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter)
     69    protected SymbolicDataAnalysisModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
     70       double lowerEstimationLimit, double upperEstimationLimit)
    6371      : base() {
    6472      this.name = ItemName;
     
    6674      this.symbolicExpressionTree = tree;
    6775      this.interpreter = interpreter;
     76      this.lowerEstimationLimit = lowerEstimationLimit;
     77      this.upperEstimationLimit = upperEstimationLimit;
    6878    }
    6979
Note: See TracChangeset for help on using the changeset viewer.