public class VehicleRoutingTable extends Object
Constructor and Description |
---|
VehicleRoutingTable(int size)
Constructs a new, empty vehicle routing table.
|
Modifier and Type | Method and Description |
---|---|
int |
getDemand(int id)
Returns the demand at the specified node.
|
boolean |
isDepot(int id)
Returns
true if this is a depot node; false otherwise. |
void |
loadDemands(BufferedReader reader)
Loads the demands from the specified reader.
|
void |
loadDepots(BufferedReader reader)
Loads the depot list from the given reader.
|
public VehicleRoutingTable(int size)
size
- the number of nodes the the problem instancepublic void loadDemands(BufferedReader reader) throws IOException
reader
- the reader containing the demandsIOException
- if an I/O error occurred while reading the demandspublic void loadDepots(BufferedReader reader) throws IOException
reader
- the reader that defines the depot nodesIOException
- if an I/O error occurred while reading the depot
listpublic int getDemand(int id)
id
- the identifier of the nodeIllegalArgumentException
- if a node with the specified identifier
does not existpublic boolean isDepot(int id)
true
if this is a depot node; false
otherwise.id
- the identifier of the nodetrue
if this is a depot node; false
otherwiseIllegalArgumentException
- if a node with the specified identifier
does not existCopyright © 2016. All rights reserved.