public class TSPLibInstance extends Object
Constructor and Description |
---|
TSPLibInstance()
Constructs a new, empty TSPLIB problem instance.
|
TSPLibInstance(File file)
Constructs a TSPLIB problem instance from the specified TSPLIB file.
|
TSPLibInstance(InputStream inputStream)
Constructs a TSPLIB problem instance from the specified TSPLIB file.
|
Modifier and Type | Method and Description |
---|---|
void |
addTour(File file)
Adds a solution to this TSPLIB problem instance that is defined in a
separate file.
|
void |
addTour(InputStream inputStream)
Adds a solution to this TSPLIB problem instance that is defined in a
separate file.
|
void |
addTour(TSPLibTour tour)
Adds a solution to this TSPLIB problem instance.
|
int |
getCapacity()
Returns the truck capacity in CVRP problem instances.
|
String |
getComment()
Returns any comments about this problem instance.
|
DataType |
getDataType()
Returns the type of this problem instance.
|
int |
getDimension()
Returns the number of nodes defined by this problem instance.
|
NodeCoordinates |
getDisplayData()
Returns the data used to graphically display the nodes; or
null
if the display data is not explicitly defined. |
DisplayDataType |
getDisplayDataType()
Returns the way graphical displays of the data should be generated.
|
DistanceTable |
getDistanceTable()
Returns the distance table that defines the nodes, edges, and weights
for this problem instance.
|
EdgeDataFormat |
getEdgeDataFormat()
Returns the format of edge data; or
null if edge data is not
explicitly defined. |
EdgeWeightFormat |
getEdgeWeightFormat()
Returns the format of the edge weight matrix when explicit weights are
used; or
null if edge weights are not explicit. |
EdgeWeightType |
getEdgeWeightType()
Returns the way edge weights are specified.
|
EdgeData |
getFixedEdges()
Returns the edges that are required in each solution to this problem
instance.
|
String |
getName()
Returns the name of this problem instance.
|
NodeCoordType |
getNodeCoordinateType()
Returns the format of node coordinate data.
|
List<TSPLibTour> |
getTours()
Returns the solutions to this problem instance.
|
VehicleRoutingTable |
getVehicleRoutingTable()
Returns the demands and depot nodes for vehicle routing problems; or
null if this is not a vehicle routing problem instance. |
void |
load(BufferedReader reader)
Loads a problem instance from the specified TSPLIB file.
|
public TSPLibInstance()
public TSPLibInstance(File file) throws IOException
file
- the TSPLIB file defining the problemIOException
- if an I/O error occurred while loading the TSPLIB
filepublic TSPLibInstance(InputStream inputStream) throws IOException
inputStream
- inputStream to the TSPLIB file defining the problemIOException
- if an I/O error occurred while loading the TSPLIB
filepublic void load(BufferedReader reader) throws IOException
reader
- input stream to a TSPLIB file defining the problemIOException
- if an I/O error occurred while loading the TSPLIB
filepublic void addTour(TSPLibTour tour)
tour
- the solution to addpublic void addTour(File file) throws IOException
file
- the file containing a solution to this TSPLIB problem
instanceIOException
- if an I/O error occurred while loading the tourpublic void addTour(InputStream inputStream) throws IOException
inputStream
- inputStream to the file containing a solution to this TSPLIB problem
instanceIOException
- if an I/O error occurred while loading the tourpublic String getName()
public DataType getDataType()
public String getComment()
public int getDimension()
public int getCapacity()
CVRP
.public EdgeWeightType getEdgeWeightType()
public EdgeWeightFormat getEdgeWeightFormat()
null
if edge weights are not explicit.null
if edge weights are not explicitpublic EdgeDataFormat getEdgeDataFormat()
null
if edge data is not
explicitly defined.null
if edge data is not
explicitly definedpublic NodeCoordType getNodeCoordinateType()
public DisplayDataType getDisplayDataType()
public DistanceTable getDistanceTable()
public NodeCoordinates getDisplayData()
null
if the display data is not explicitly defined.null
if the display data is not explicitly definedpublic EdgeData getFixedEdges()
public List<TSPLibTour> getTours()
public VehicleRoutingTable getVehicleRoutingTable()
null
if this is not a vehicle routing problem instance.null
if this is not a vehicle routing problem instanceCopyright © 2016. All rights reserved.