Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7758 for branches


Ignore:
Timestamp:
04/24/12 15:22:13 (12 years ago)
Author:
sforsten
Message:

#1784:

  • deleted not needed Consumer in ProblemInstanceProvider and IProblemInstanceProvider
  • changed protection level of exporter and consumer in ProblemInstanceProviderViewGeneric
  • renamed property FileExtension to FileName in ResourceClassificationInstanceProvider and ResourceRegressionInstanceProvider
  • deleted ImportProblemDataFromFile method from IDataAnalysisProblem and all classes and interfaces, which implement this method
  • removed unnecessary yield return in GetDoubleValues in the Dataset. Now it's a normal return statement
Location:
branches/ProblemInstancesRegressionAndClassification
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab 3.3.sln

    r7754 r7758  
    3131EndProject
    3232Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.Instances.TSPLIB.Views-3.3", "HeuristicLab.Problems.Instances.TSPLIB.Views\3.3\HeuristicLab.Problems.Instances.TSPLIB.Views-3.3.csproj", "{B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9}"
     33EndProject
     34Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Problems.DataAnalysis.Symbolic-3.4", "HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj", "{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}"
    3335EndProject
    3436Global
     
    224226    {B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9}.Release|x86.ActiveCfg = Release|x86
    225227    {B7FA451C-26BF-4EE5-8E0E-BECAADA5B8E9}.Release|x86.Build.0 = Release|x86
     228    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     229    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Any CPU.Build.0 = Debug|Any CPU
     230    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
     231    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|Mixed Platforms.Build.0 = Debug|x86
     232    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x64.ActiveCfg = Debug|x64
     233    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x64.Build.0 = Debug|x64
     234    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x86.ActiveCfg = Debug|x86
     235    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Debug|x86.Build.0 = Debug|x86
     236    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Any CPU.ActiveCfg = Release|Any CPU
     237    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Any CPU.Build.0 = Release|Any CPU
     238    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Mixed Platforms.ActiveCfg = Release|x86
     239    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|Mixed Platforms.Build.0 = Release|x86
     240    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x64.ActiveCfg = Release|x64
     241    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x64.Build.0 = Release|x64
     242    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x86.ActiveCfg = Release|x86
     243    {3D28463F-EC96-4D82-AFEE-38BE91A0CA00}.Release|x86.Build.0 = Release|x86
    226244  EndGlobalSection
    227245  GlobalSection(SolutionProperties) = preSolution
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification-3.4.csproj

    r7754 r7758  
    141141      <Private>False</Private>
    142142    </Reference>
    143     <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
    144       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
    145       <Private>False</Private>
    146     </Reference>
    147143    <Reference Include="System" />
    148144    <Reference Include="System.Core">
     
    197193  </ItemGroup>
    198194  <ItemGroup>
     195    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     196      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
     197      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     198    </ProjectReference>
    199199    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    200200      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs

    r7259 r7758  
    107107      }
    108108    }
    109 
    110     public override void ImportProblemDataFromFile(string fileName) {
    111       ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName);
    112       ProblemData = problemData;
    113     }
    114109  }
    115110}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveProblem.cs

    r7750 r7758  
    113113    }
    114114
    115     public override void ImportProblemDataFromFile(string fileName) {
    116       ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName);
    117       ProblemData = problemData;
    118     }
    119 
    120115    public void Load(ClassificationData data) {
    121116      Name = data.Name;
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj

    r7754 r7758  
    141141      <Private>False</Private>
    142142    </Reference>
    143     <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic-3.4">
    144       <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll</HintPath>
    145       <Private>False</Private>
    146     </Reference>
    147143    <Reference Include="System" />
    148144    <Reference Include="System.Core">
     
    192188  </ItemGroup>
    193189  <ItemGroup>
     190    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj">
     191      <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project>
     192      <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name>
     193    </ProjectReference>
    194194    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    195195      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveProblem.cs

    r7259 r7758  
    111111      }
    112112    }
    113 
    114     public override void ImportProblemDataFromFile(string fileName) {
    115       RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);
    116       ProblemData = problemData;
    117     }
    118113  }
    119114}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/SymbolicRegressionSingleObjectiveProblem.cs

    r7750 r7758  
    116116    }
    117117
    118     public override void ImportProblemDataFromFile(string fileName) {
    119       RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);
    120       ProblemData = problemData;
    121     }
    122 
    123118    public void Load(RegressionData data) {
    124119      Name = data.Name;
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj

    r7734 r7758  
    5050    <DebugType>pdbonly</DebugType>
    5151    <Optimize>true</Optimize>
    52     <OutputPath>$(SolutionDir)\bin\</OutputPath>
     52    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
    5353    <DefineConstants>TRACE</DefineConstants>
    5454    <ErrorReport>prompt</ErrorReport>
     
    9494  <ItemGroup>
    9595    <Reference Include="ALGLIB-3.5.0, Version=3.5.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
    96       <HintPath>..\..\bin\ALGLIB-3.5.0.dll</HintPath>
     96      <Private>False</Private>
     97    </Reference>
     98    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     99      <Private>False</Private>
     100    </Reference>
     101    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     102      <Private>False</Private>
     103    </Reference>
     104    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     105      <Private>False</Private>
     106    </Reference>
     107    <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     108      <Private>False</Private>
     109    </Reference>
     110    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     111      <Private>False</Private>
     112    </Reference>
     113    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     114      <Private>False</Private>
     115    </Reference>
     116    <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     117      <Private>False</Private>
     118    </Reference>
     119    <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     120      <Private>False</Private>
     121    </Reference>
     122    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     123      <Private>False</Private>
     124    </Reference>
     125    <Reference Include="HeuristicLab.Optimization.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     126      <Private>False</Private>
     127    </Reference>
     128    <Reference Include="HeuristicLab.Parameters-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     129      <Private>False</Private>
     130    </Reference>
     131    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     132      <Private>False</Private>
     133    </Reference>
     134    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     135      <Private>False</Private>
     136    </Reference>
     137    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
     138      <Private>False</Private>
    97139    </Reference>
    98140    <Reference Include="System" />
     
    228270  </ItemGroup>
    229271  <ItemGroup>
    230     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
    231       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
    232       <Name>HeuristicLab.Analysis-3.3</Name>
    233       <Private>False</Private>
    234     </ProjectReference>
    235     <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
    236       <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
    237       <Name>HeuristicLab.Collections-3.3</Name>
    238       <Private>False</Private>
    239     </ProjectReference>
    240     <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.3\HeuristicLab.Common.Resources-3.3.csproj">
    241       <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
    242       <Name>HeuristicLab.Common.Resources-3.3</Name>
    243       <Private>False</Private>
    244     </ProjectReference>
    245     <ProjectReference Include="..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
    246       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
    247       <Name>HeuristicLab.Common-3.3</Name>
    248       <Private>False</Private>
    249     </ProjectReference>
    250     <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    251       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    252       <Name>HeuristicLab.Core-3.3</Name>
    253       <Private>False</Private>
    254     </ProjectReference>
    255     <ProjectReference Include="..\..\HeuristicLab.Data\3.3\HeuristicLab.Data-3.3.csproj">
    256       <Project>{BBAB9DF5-5EF3-4BA8-ADE9-B36E82114937}</Project>
    257       <Name>HeuristicLab.Data-3.3</Name>
    258       <Private>False</Private>
    259     </ProjectReference>
    260     <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj">
    261       <Project>{06D4A186-9319-48A0-BADE-A2058D462EEA}</Project>
    262       <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name>
    263       <Private>False</Private>
    264     </ProjectReference>
    265     <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj">
    266       <Project>{23DA7FF4-D5B8-41B6-AA96-F0561D24F3EE}</Project>
    267       <Name>HeuristicLab.Operators-3.3</Name>
    268       <Private>False</Private>
    269     </ProjectReference>
    270     <ProjectReference Include="..\..\HeuristicLab.Optimization.Operators\3.3\HeuristicLab.Optimization.Operators-3.3.csproj">
    271       <Project>{25087811-F74C-4128-BC86-8324271DA13E}</Project>
    272       <Name>HeuristicLab.Optimization.Operators-3.3</Name>
    273       <Private>False</Private>
    274     </ProjectReference>
    275     <ProjectReference Include="..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
    276       <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
    277       <Name>HeuristicLab.Optimization-3.3</Name>
    278       <Private>False</Private>
    279     </ProjectReference>
    280     <ProjectReference Include="..\..\HeuristicLab.Parameters\3.3\HeuristicLab.Parameters-3.3.csproj">
    281       <Project>{56F9106A-079F-4C61-92F6-86A84C2D84B7}</Project>
    282       <Name>HeuristicLab.Parameters-3.3</Name>
    283       <Private>False</Private>
    284     </ProjectReference>
    285     <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
    286       <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
    287       <Name>HeuristicLab.Persistence-3.3</Name>
    288       <Private>False</Private>
    289     </ProjectReference>
    290     <ProjectReference Include="..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
    291       <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
    292       <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
    293       <Private>False</Private>
    294     </ProjectReference>
    295272    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    296273      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    297274      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
    298       <Private>False</Private>
    299     </ProjectReference>
    300     <ProjectReference Include="..\..\HeuristicLab.Random\3.3\HeuristicLab.Random-3.3.csproj">
    301       <Project>{F4539FB6-4708-40C9-BE64-0A1390AEA197}</Project>
    302       <Name>HeuristicLab.Random-3.3</Name>
    303275      <Private>False</Private>
    304276    </ProjectReference>
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r7726 r7758  
    319319      }
    320320    }
    321 
    322     public abstract void ImportProblemDataFromFile(string fileName);
    323321  }
    324322}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs

    r7750 r7758  
    166166      if (values == null) throw new ArgumentException("The variable " + variableName + " is not a double variable.");
    167167
    168       //mkommend yield return used to enable lazy evaluation
    169       foreach (double value in values)
    170         yield return value;
     168      return values;
    171169    }
    172170    public ReadOnlyCollection<double> GetReadOnlyDoubleValues(string variableName) {
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs

    r7750 r7758  
    4646    }
    4747
    48     public override void ImportProblemDataFromFile(string fileName) {
    49       ClassificationProblemData problemData = ClassificationProblemData.ImportFromFile(fileName);
    50       ProblemData = problemData;
    51     }
    52 
    5348    public void Load(ClassificationData data) {
    5449      Name = data.Name;
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs

    r7603 r7758  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.IO;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    2928using HeuristicLab.Parameters;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Problems.Instances;
    3230
    3331namespace HeuristicLab.Problems.DataAnalysis {
     
    404402    }
    405403    #endregion
    406 
    407     #region Import from file
    408     public static ClassificationProblemData ImportFromFile(string fileName) {
    409       TableFileParser csvFileParser = new TableFileParser();
    410       csvFileParser.Parse(fileName);
    411 
    412       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    413       dataset.Name = Path.GetFileName(fileName);
    414 
    415       ClassificationProblemData problemData = new ClassificationProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
    416       problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    417       return problemData;
    418     }
    419     #endregion
    420404  }
    421405}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs

    r7259 r7758  
    3838      ProblemData = new ClusteringProblemData();
    3939    }
    40 
    41     public override void ImportProblemDataFromFile(string fileName) {
    42       ClusteringProblemData problemData = ClusteringProblemData.ImportFromFile(fileName);
    43       ProblemData = problemData;
    44     }
    4540  }
    4641}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblemData.cs

    r7603 r7758  
    2121
    2222using System.Collections.Generic;
    23 using System.IO;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.Problems.Instances;
    2826
    2927namespace HeuristicLab.Problems.DataAnalysis {
     
    9189      : base(dataset, allowedInputVariables) {
    9290    }
    93 
    94 
    95     #region Import from file
    96     public static ClusteringProblemData ImportFromFile(string fileName) {
    97       TableFileParser csvFileParser = new TableFileParser();
    98       csvFileParser.Parse(fileName);
    99 
    100       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    101       dataset.Name = Path.GetFileName(fileName);
    102 
    103       ClusteringProblemData problemData = new ClusteringProblemData(dataset, dataset.DoubleVariables);
    104       problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    105       return problemData;
    106     }
    107     #endregion
    10891  }
    10992}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs

    r7259 r7758  
    9090      if (handler != null) handler(this, EventArgs.Empty);
    9191    }
    92 
    93     public abstract void ImportProblemDataFromFile(string fileName);
    9492  }
    9593}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs

    r7683 r7758  
    4646    }
    4747
    48     public override void ImportProblemDataFromFile(string fileName) {
    49       RegressionProblemData problemData = RegressionProblemData.ImportFromFile(fileName);
    50       ProblemData = problemData;
    51     }
    52 
    5348    public void Load(RegressionData data) {
    5449      Name = data.Name;
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r7603 r7758  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.IO;
    2524using System.Linq;
    2625using HeuristicLab.Common;
     
    2928using HeuristicLab.Parameters;
    3029using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Problems.Instances;
    3230
    3331namespace HeuristicLab.Problems.DataAnalysis {
     
    137135      OnChanged();
    138136    }
    139 
    140     #region Import from file
    141     public static RegressionProblemData ImportFromFile(string fileName) {
    142       TableFileParser csvFileParser = new TableFileParser();
    143       csvFileParser.Parse(fileName);
    144 
    145       Dataset dataset = new Dataset(csvFileParser.VariableNames, csvFileParser.Values);
    146       dataset.Name = Path.GetFileName(fileName);
    147 
    148       RegressionProblemData problemData = new RegressionProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
    149       problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    150       return problemData;
    151     }
    152     #endregion
    153137  }
    154138}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs

    r7259 r7758  
    2929    IDataAnalysisProblemData ProblemData { get; }
    3030    event EventHandler ProblemDataChanged;
    31 
    32     void ImportProblemDataFromFile(string fileName);
    3331  }
    3432
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Classification/3.4/RealWorld/RealWorldInstanceProvider.cs

    r7685 r7758  
    4343    }
    4444
    45     protected override string FileExtension { get { return "RealWorld"; } }
     45    protected override string FileName { get { return "RealWorld"; } }
    4646
    4747    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
     
    4949      descriptorList.Add(new Iris());
    5050      descriptorList.Add(new Mammography());
    51       var solutionsArchiveName = GetResourceName(FileExtension + @"\.zip");
     51      var solutionsArchiveName = GetResourceName(FileName + @"\.zip");
    5252      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
    5353        using (var solutionsZipFile = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Classification/3.4/ResourceClassificationInstanceProvider.cs

    r7685 r7758  
    3131  public abstract class ResourceClassificationInstanceProvider : ClassificationInstanceProvider {
    3232
    33     protected abstract string FileExtension { get; }
     33    protected abstract string FileName { get; }
    3434
    3535    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    36       var solutionsArchiveName = GetResourceName(FileExtension + @"\.zip");
     36      var solutionsArchiveName = GetResourceName(FileName + @"\.zip");
    3737      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
    3838        using (var solutionsZipFile = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
     
    6666
    6767    private string GetTempFileForResource(string resourceName) {
    68       var instanceArchiveName = GetResourceName(FileExtension + @"\.zip");
     68      var instanceArchiveName = GetResourceName(FileName + @"\.zip");
    6969      using (var instancesZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
    7070        var entry = instancesZipFile.GetEntry(resourceName);
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/RealWorld/RealWorldInstanceProvider.cs

    r7667 r7758  
    3939    }
    4040
    41     protected override string FileExtension { get { return "RealWorld"; } }
     41    protected override string FileName { get { return "RealWorld"; } }
    4242  }
    4343}
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/ResourceRegressionInstanceProvider.cs

    r7667 r7758  
    3131  public abstract class ResourceRegressionInstanceProvider : RegressionInstanceProvider {
    3232
    33     protected abstract string FileExtension { get; }
     33    protected abstract string FileName { get; }
    3434
    3535    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    36       var solutionsArchiveName = GetResourceName(FileExtension + @"\.zip");
     36      var solutionsArchiveName = GetResourceName(FileName + @"\.zip");
    3737      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
    3838        using (var solutionsZipFile = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
     
    6666
    6767    private string GetTempFileForResource(string resourceName) {
    68       var instanceArchiveName = GetResourceName(FileExtension + @"\.zip");
     68      var instanceArchiveName = GetResourceName(FileName + @"\.zip");
    6969      using (var instancesZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
    7070        var entry = instancesZipFile.GetEntry(resourceName);
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/TrentMcConaghy/TrentMcConaghyInstanceProvider.cs

    r7682 r7758  
    4343    }
    4444
    45     protected override string FileExtension { get { return "TrentMcConaghy"; } }
     45    protected override string FileName { get { return "TrentMcConaghy"; } }
    4646
    4747    public override RegressionData LoadData(IDataDescriptor id) {
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.TSPLIB.Views/3.3/TSPLIBTSPInstanceProviderView.cs

    r7754 r7758  
    2525using HeuristicLab.MainForm.WindowsForms;
    2626using HeuristicLab.Problems.Instances.Views;
     27using System.IO;
    2728
    2829namespace HeuristicLab.Problems.Instances.TSPLIB.Views {
     
    4344        if (dialog.ShowDialog() == DialogResult.OK) {
    4445          var instance = Content.LoadData(dialog.TSPFileName, dialog.TourFileName, dialog.Quality);
    45           Content.Consumer.Load(instance);
     46          try {
     47            GenericConsumer.Load(instance);
     48          }
     49          catch (Exception ex) {
     50            MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance");
     51          }
    4652        }
    4753      }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceProviderViewGeneric.Designer.cs

    r7684 r7758  
    8383      // instancesComboBox
    8484      //
    85       this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
     85      this.instancesComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    8686            | System.Windows.Forms.AnchorStyles.Right)));
    8787      this.instancesComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     
    128128      // problemInstanceProviderSplitContainer
    129129      //
    130       this.problemInstanceProviderSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
    131             | System.Windows.Forms.AnchorStyles.Left) 
     130      this.problemInstanceProviderSplitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     131            | System.Windows.Forms.AnchorStyles.Left)
    132132            | System.Windows.Forms.AnchorStyles.Right)));
    133133      this.problemInstanceProviderSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
     
    168168    #endregion
    169169
    170     private System.Windows.Forms.OpenFileDialog openFileDialog;
    171     private System.Windows.Forms.ToolTip toolTip;
     170    protected System.Windows.Forms.OpenFileDialog openFileDialog;
     171    protected System.Windows.Forms.ToolTip toolTip;
    172172    protected System.Windows.Forms.Button loadButton;
    173173    protected System.Windows.Forms.Label instanceLabel;
     
    175175    protected System.Windows.Forms.Button importButton;
    176176    protected System.Windows.Forms.Button exportButton;
    177     private System.Windows.Forms.SaveFileDialog saveFileDialog;
    178     private System.Windows.Forms.SplitContainer problemInstanceProviderSplitContainer;
     177    protected System.Windows.Forms.SaveFileDialog saveFileDialog;
     178    protected System.Windows.Forms.SplitContainer problemInstanceProviderSplitContainer;
    179179
    180180  }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceProviderViewGeneric.cs

    r7698 r7758  
    3939    }
    4040
    41     private IProblemInstanceConsumer<T> GenericConsumer { get { return Consumer as IProblemInstanceConsumer<T>; } }
    42     public IProblemInstanceConsumer consumer;
     41    protected IProblemInstanceConsumer<T> GenericConsumer { get { return Consumer as IProblemInstanceConsumer<T>; } }
     42    protected IProblemInstanceConsumer consumer;
    4343    public override IProblemInstanceConsumer Consumer {
    4444      get { return consumer; }
     
    4949    }
    5050
    51     private IProblemInstanceExporter<T> GenericExporter { get { return Exporter as IProblemInstanceExporter<T>; } }
    52     private IProblemInstanceExporter exporter;
     51    protected IProblemInstanceExporter<T> GenericExporter { get { return Exporter as IProblemInstanceExporter<T>; } }
     52    protected IProblemInstanceExporter exporter;
    5353    public override IProblemInstanceExporter Exporter {
    5454      get { return exporter; }
     
    6363      importButton.Text = String.Empty;
    6464      importButton.Image = VSImageLibrary.Open;
    65       toolTip.SetToolTip(importButton, "Import a " + GetProblemType() + " instance from file.");
     65      toolTip.SetToolTip(importButton, "Import a " + GetProblemType() + " problem from file.");
    6666      exportButton.Text = String.Empty;
    6767      exportButton.Image = VSImageLibrary.Save;
    68       toolTip.SetToolTip(exportButton, "Export a " + GetProblemType() + " instance to a file.");
     68      toolTip.SetToolTip(exportButton, "Export currently loaded " + GetProblemType() + " problem to a file.");
    6969      loadButton.Text = String.Empty;
    7070      loadButton.Image = VSImageLibrary.RefreshDocument;
    71       toolTip.SetToolTip(loadButton, "Load the selected instance.");
     71      toolTip.SetToolTip(loadButton, "Load the selected problem.");
    7272    }
    7373
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs

    r7548 r7758  
    3333
    3434  public interface IProblemInstanceProvider<TData> : IProblemInstanceProvider {
    35     IProblemInstanceConsumer<TData> Consumer { get; set; }
    36 
    3735    IEnumerable<IDataDescriptor> GetDataDescriptors();
    3836    TData LoadData(IDataDescriptor descriptor);
    3937    TData LoadData(string path);
    40    
     38
    4139    void SaveData(TData instance, string path);
    4240  }
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs

    r7548 r7758  
    2525namespace HeuristicLab.Problems.Instances {
    2626  public abstract class ProblemInstanceProvider<TData> : IProblemInstanceProvider<TData> {
    27     public virtual IProblemInstanceConsumer<TData> Consumer { get; set; }
    28 
    2927    public abstract string Name { get; }
    3028    public abstract string Description { get; }
Note: See TracChangeset for help on using the changeset viewer.