Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/13 01:20:12 (11 years ago)
Author:
jhelm
Message:

#1966: More refactoring; Added more sophisticated structures for packing-plan and bin-packing representation; Transferred parts of the decoding-algorithms to these structures; Did some more refactoring and cleanup;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Instances/BPPORLIBParser.cs

    r9348 r9596  
    9090
    9191      for (int k = 0; k < Items; k++) {
    92         if (reader.EndOfStream) throw new InvalidDataException("Unexpected End of Stream.");
     92        if (reader.EndOfStream) throw new InvalidDataException("Unexpected End of Stream (at line " + k + ").");
    9393        var valLine = reader.ReadLine();
    9494        while (String.IsNullOrWhiteSpace(valLine)) valLine = reader.ReadLine();
     
    101101      }
    102102
    103       int problemClassNr = int.Parse(problemClass[0]);
    104       Name = (isThreeDimensional ? "3" : "2") + "dbpp_class_0" + problemClassNr;
    105       if (!isThreeDimensional) {
    106         if (problemClassNr >= 1 && problemClassNr <= 5)
    107           Description = "Proposed by Berkey and Wang.";
    108         else if (problemClassNr >= 6 && problemClassNr <= 10)
    109           Description = "Proposed by Martello and Vigo.";
     103      Int32 problemClassNr = -1;
     104      if (int.TryParse(problemClass[0], out problemClassNr)) {
     105        Name = (isThreeDimensional ? "3" : "2") + "dbpp_class_0" + problemClassNr;
     106        if (!isThreeDimensional) {
     107          if (problemClassNr >= 1 && problemClassNr <= 5)
     108            Description = "Proposed by Berkey and Wang.";
     109          else if (problemClassNr >= 6 && problemClassNr <= 10)
     110            Description = "Proposed by Martello and Vigo.";
     111        } else {
     112          if (problemClassNr >= 1 && problemClassNr <= 5)
     113            Description = "Proposed by Martello and Vigo.";
     114          else if (problemClassNr >= 6 && problemClassNr <= 9)
     115            Description = "Proposed by Berkey and Wang.";
     116        }
    110117      } else {
    111         if (problemClassNr >= 1 && problemClassNr <= 5)
    112           Description = "Proposed by Martello and Vigo.";
    113         else if (problemClassNr >= 6 && problemClassNr <= 9)
    114           Description = "Proposed by Berkey and Wang.";
     118        Name = "Unknown";
     119        Description = "<Missing>";
    115120      }
    116121     
Note: See TracChangeset for help on using the changeset viewer.