Class InstanceImporter<I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.io.InstanceImporter<I>
Type Parameters:
I - type of the problem instance
Direct Known Subclasses:
__RNAME__InstanceImporter, ACInstanceImporter, TSPInstanceImporter

public abstract class InstanceImporter<I extends Instance> extends Object
This class is used to generate an instance for the problem.
  • Constructor Details

    • InstanceImporter

      public InstanceImporter()
  • Method Details

    • importInstance

      public I importInstance(String instancePath)
      Create an instance from the format used by the problem. After this method finishes executing, the Instance object MUST BE IMMUTABLE.
      Parameters:
      instancePath - File path from where we will load the data
      Returns:
      The instance object that represents this object
    • importInstance

      public abstract I importInstance(BufferedReader reader, String suggestedInstanceId) throws IOException
      Create an instance from the format used by the problem. After this method finishes executing, the Instance object MUST BE IMMUTABLE.
      Parameters:
      reader - Input buffer, managed by the framework
      suggestedInstanceId - Filename on disk
      Returns:
      The instance object that represents this object
      Throws:
      IOException - If an error is encountered while the instance is being parsed