Changeset 7548 for branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3/QAPLIBInstanceProvider.cs
- Timestamp:
- 03/05/12 16:30:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.Instances.QAPLIB/3.3/QAPLIBInstanceProvider.cs
r7538 r7548 28 28 29 29 namespace HeuristicLab.Problems.Instances.QAPLIB { 30 public class QAPLIBInstanceProvider : ProblemInstanceProvider<QAP Instance> {30 public class QAPLIBInstanceProvider : ProblemInstanceProvider<QAPData> { 31 31 public override string Name { 32 32 get { return "QAPLIB"; } … … 49 49 } 50 50 51 public override IEnumerable<I InstanceDescriptor> GetInstanceDescriptors() {51 public override IEnumerable<IDataDescriptor> GetDataDescriptors() { 52 52 var solutions = Assembly.GetExecutingAssembly() 53 53 .GetManifestResourceNames() … … 59 59 .Where(x => x.EndsWith(".dat")) 60 60 .OrderBy(x => x) 61 .Select(x => new QAPLIB InstanceDescriptor(GetPrettyName(x), GetDescription(), x, solutions.ContainsKey(x) ? solutions[x] : String.Empty));61 .Select(x => new QAPLIBDataDescriptor(GetPrettyName(x), GetDescription(), x, solutions.ContainsKey(x) ? solutions[x] : String.Empty)); 62 62 } 63 63 64 public override QAP Instance LoadInstance(IInstanceDescriptor id) {65 var descriptor = (QAPLIB InstanceDescriptor)id;64 public override QAPData LoadData(IDataDescriptor id) { 65 var descriptor = (QAPLIBDataDescriptor)id; 66 66 using (var stream = Assembly.GetExecutingAssembly() 67 67 .GetManifestResourceStream(descriptor.InstanceIdentifier)) { … … 87 87 } 88 88 89 public override QAP Instance LoadInstance(string path) {89 public override QAPData LoadData(string path) { 90 90 var parser = new QAPLIBParser(); 91 91 parser.Parse(path); … … 96 96 } 97 97 98 public override void Save Instance(QAPInstanceinstance, string path) {98 public override void SaveData(QAPData instance, string path) { 99 99 throw new NotSupportedException(); 100 100 } 101 101 102 private QAP InstanceLoad(QAPLIBParser parser) {103 var instance = new QAP Instance();102 private QAPData Load(QAPLIBParser parser) { 103 var instance = new QAPData(); 104 104 instance.Dimension = parser.Size; 105 105 instance.Distances = parser.Distances;
Note: See TracChangeset
for help on using the changeset viewer.