Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/10/14 10:31:41 (10 years ago)
Author:
pfleck
Message:

#2269 Merged trunk. Updated .net version of ALPS plugin.

Location:
branches/ALPS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ALPS

  • branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic.Views

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

    r11171 r11677  
    3030namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
    3131  public class SymbolicSolutionExcelExporter : IDataAnalysisSolutionExporter {
    32     private const string TRAININGSTART = "TrainingStart";
    33     private const string TRAININGEND = "TrainingEnd";
    34     private const string TESTSTART = "TestStart";
    35     private const string TESTEND = "TestEnd";
     32    protected const string TRAININGSTART = "TrainingStart";
     33    protected const string TRAININGEND = "TrainingEnd";
     34    protected const string TESTSTART = "TestStart";
     35    protected const string TESTEND = "TestEnd";
    3636
    3737
     
    4444    }
    4545
    46     public void Export(IDataAnalysisSolution solution, string fileName) {
     46    public virtual void Export(IDataAnalysisSolution solution, string fileName) {
    4747      var symbSolution = solution as ISymbolicDataAnalysisSolution;
    4848      if (symbSolution == null) throw new NotSupportedException("This solution cannot be exported to Excel");
     
    216216    }
    217217
    218     private string Indirect(string column, bool training) {
     218    protected string Indirect(string column, bool training) {
    219219      if (training) {
    220220        return string.Format("INDIRECT(\"'Estimated Values'!{0}\"&{1}+2&\":{0}\"&{2}+1)", column, TRAININGSTART, TRAININGEND);
     
    260260    }
    261261
    262     private void AddModelTreePicture(ExcelWorksheet modelWorksheet, ISymbolicDataAnalysisModel model) {
     262    protected void AddModelTreePicture(ExcelWorksheet modelWorksheet, ISymbolicDataAnalysisModel model) {
    263263      SymbolicExpressionTreeChart modelTreePicture = new SymbolicExpressionTreeChart();
    264264      modelTreePicture.Tree = model.SymbolicExpressionTree;
     
    289289      estimatedWorksheet.Cells[1, 1, 1, 10].AutoFitColumns();
    290290
     291      // fill in id, target variable and unbounded estimated values
    291292      int targetIndex = solution.ProblemData.Dataset.VariableNames.ToList().FindIndex(x => x.Equals(solution.ProblemData.TargetVariable)) + 1;
    292293      for (int i = 0; i < rows; i++) {
    293         estimatedWorksheet.Cells[i + 2, 1].Value = i;
    294         estimatedWorksheet.Cells[i + 2, 2].Formula = datasetWorksheet.Cells[i + 2, targetIndex].FullAddress;
    295         estimatedWorksheet.Cells[i + 2, 9].Formula = string.Format(preparedFormula, i + 2);
     294        estimatedWorksheet.Cells[i + 2, 1].Value = i; // id
     295        estimatedWorksheet.Cells[i + 2, 2].Formula = datasetWorksheet.Cells[i + 2, targetIndex].FullAddress; // target variable
     296        estimatedWorksheet.Cells[i + 2, 9].Formula = string.Format(preparedFormula, i + 2); // unbounded estimated values
    296297      }
    297298      estimatedWorksheet.Cells["B2:B" + (rows + 1)].Style.Numberformat.Format = "0.000";
     
    313314    }
    314315
    315     private string PrepareFormula(string[] formulaParts) {
     316    protected string PrepareFormula(string[] formulaParts) {
    316317      string preparedFormula = formulaParts[0];
    317318      foreach (var part in formulaParts.Skip(2)) {
     
    323324    }
    324325
    325     private void WriteInputSheet(ExcelWorksheet inputsWorksheet, ExcelWorksheet datasetWorksheet, IEnumerable<string> list, Dataset dataset) {
     326    protected void WriteInputSheet(ExcelWorksheet inputsWorksheet, ExcelWorksheet datasetWorksheet, IEnumerable<string> list, Dataset dataset) {
    326327      //remark the performance of EPPlus drops dramatically
    327328      //if the data is not written row wise (from left to right) due the internal indices used.
     
    337338    }
    338339
    339     private void WriteDatasetToExcel(ExcelWorksheet datasetWorksheet, IDataAnalysisProblemData problemData) {
     340    protected void WriteDatasetToExcel(ExcelWorksheet datasetWorksheet, IDataAnalysisProblemData problemData) {
    340341      //remark the performance of EPPlus drops dramatically
    341342      //if the data is not written row wise (from left to right) due the internal indices used.
  • branches/ALPS/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r10545 r11677  
    1111    <RootNamespace>HeuristicLab.Problems.DataAnalysis.Symbolic.Views</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4</AssemblyName>
    13     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1414    <TargetFrameworkProfile>
    1515    </TargetFrameworkProfile>
     
    4646    <WarningLevel>4</WarningLevel>
    4747    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     48    <Prefer32Bit>false</Prefer32Bit>
    4849  </PropertyGroup>
    4950  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    5556    <WarningLevel>4</WarningLevel>
    5657    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     58    <Prefer32Bit>false</Prefer32Bit>
    5759  </PropertyGroup>
    5860  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     
    6466    <ErrorReport>prompt</ErrorReport>
    6567    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     68    <Prefer32Bit>false</Prefer32Bit>
    6669  </PropertyGroup>
    6770  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     
    7376    <ErrorReport>prompt</ErrorReport>
    7477    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     78    <Prefer32Bit>false</Prefer32Bit>
    7579  </PropertyGroup>
    7680  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     
    8286    <ErrorReport>prompt</ErrorReport>
    8387    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     88    <Prefer32Bit>false</Prefer32Bit>
    8489  </PropertyGroup>
    8590  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
     
    9196    <ErrorReport>prompt</ErrorReport>
    9297    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
     98    <Prefer32Bit>false</Prefer32Bit>
    9399  </PropertyGroup>
    94100  <ItemGroup>
Note: See TracChangeset for help on using the changeset viewer.