Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/27/12 16:58:22 (12 years ago)
Author:
sforsten
Message:

#1784:

  • updated the Plugin.cs.frame files
  • added other real world problem instances
  • put some methods from TrentMcConaghyInstanceProvider to the super class ResourceRegressionInstanceProvider
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/TrentMcConaghy/TrentMcConaghyInstanceProvider.cs

    r7666 r7667  
    2121
    2222using System;
    23 using System.Collections.Generic;
    24 using System.IO;
    2523using System.Linq;
    26 using ICSharpCode.SharpZipLib.Zip;
    2724
    2825namespace HeuristicLab.Problems.Instances.Regression {
     
    4845    protected override string FileExtension { get { return "TrentMcConaghy"; } }
    4946
    50     public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    51       var solutionsArchiveName = GetResourceName(FileExtension + @"\.zip");
    52       if (!String.IsNullOrEmpty(solutionsArchiveName)) {
    53         using (var solutionsZipFile = new ZipInputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
    54           foreach (var entry in GetZipContents(solutionsZipFile).OrderBy(x => x))
    55             yield return new ResourceRegressionDataDescriptor(Path.GetFileNameWithoutExtension(entry), Description, entry);
    56         }
    57       }
    58     }
    59 
    6047    public override RegressionData LoadData(IDataDescriptor id) {
    6148      RegressionData regData = base.LoadData(id);
     
    6653      return regData;
    6754    }
    68 
    69     protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {
    70       ZipEntry entry;
    71       while ((entry = zipFile.GetNextEntry()) != null) {
    72         yield return entry.Name;
    73       }
    74     }
    7555  }
    7656}
Note: See TracChangeset for help on using the changeset viewer.