Package es.urjc.etsii.grafo.io
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
This class is used to generate an instance for the problem.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract I
importInstance
(BufferedReader reader, String suggestedInstanceId) Create an instance from the format used by the problem.importInstance
(String instancePath) Create an instance from the format used by the problem.
-
Constructor Details
-
InstanceImporter
public InstanceImporter()
-
-
Method Details
-
importInstance
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 frameworksuggestedInstanceId
- Filename on disk- Returns:
- The instance object that represents this object
- Throws:
IOException
- If an error is encountered while the instance is being parsed
-