Datasets¶
Bunch
¶
Dictionary-like object returned when fetching data sets.
Some common options:
Option | Type | Description | Default |
---|---|---|---|
data | List[Any] | An array of data for a set of instances | List[] |
instance | Optional[Any] | Data for a specified instance otherwise | None |
DESCR | str | The full description of the data set | None |
__init__(self, **kwargs)
special
¶
Initialize the dictionary object
linerlib
¶
GraphBuilder
¶
Convinience builder class for constructiong graphs for liner shipping networks.
capacity: List[int]
class-attribute
¶
The edge capacities.
cost: List[float]
class-attribute
¶
The edge costs.
edgeForfeitCost
class-attribute
¶
The forfeit edge cost.
edgeLoadCost
class-attribute
¶
The load/unload edge cost.
edgeLoadTime
class-attribute
¶
The load/unload edge time.
edgeTransitCost
class-attribute
¶
The transsipment edge cost.
edgeTransitTime
class-attribute
¶
The transsipment edge time.
travelTime: List[float]
class-attribute
¶
The edge transshipment times.
__init__(self, data, network)
special
¶
Initialize graph builder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
|
Bunch of instance data. |
required |
network |
|
Bunch of network rotation data. |
required |
destinationNodes(self)
¶
The destination nodes for the commodities.
Returns:
Type | Description |
---|---|
List[str] |
The names like |
forfeitEdges(self)
¶
The forfeit edges.
Returns:
Type | Description |
---|---|
List[Tuple[str, str]] |
Pairs of origin/desition node names. |
loadEdges(self)
¶
The load/unload edges.
Returns:
Type | Description |
---|---|
List[Tuple[str, str]] |
Pairs of port node and origin/destination node names. |
originNodes(self)
¶
The origin nodes for the commodities.
Returns:
Type | Description |
---|---|
List[str] |
The names like |
portCallNodes(self)
¶
The port call nodes are ports reached by a rotation.
Returns:
Type | Description |
---|---|
List[str] |
The names like |
transitEdges(self)
¶
The transshipment edges.
Returns:
Type | Description |
---|---|
List[Tuple[str, str]] |
Pairs of port node names. |
voyageEdges(self)
¶
The voyage edges.
Returns:
Type | Description |
---|---|
List[Tuple[str, str]] |
Pairs of port node names. |
fetch_linerlib(instance=None, return_raw=True)
¶
Fetches data sets from the GitHub repository of LINERLIB.
Usage for getting an instances is:
data = fetch_linerlib(instance="Baltic")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance |
str |
String identifier of the instance. If |
None |
return_raw |
|
If |
True |
Returns:
Type | Description |
---|---|
Bunch |
Network and demand information. |
fetch_linerlib_rotations(instance=None, return_raw=True)
¶
Gets the networks calculated in "A Matheuristic for the Liner Shipping Network Design Problem with Transit Time Restrictions" by Brouer et al. 2015 from the LINERLIB GitHub repository
Usage for getting the rotations related to an instance is:
data = fetch_linerlib(instance="Baltic")
network = fetch_linerlib_rotations(instance="Baltic_best_base")
This can be feeded into the GraphBuilder.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
instance |
str |
String identifier of the instance. If Note: Instance |
None |
return_raw |
|
If |
True |
Returns:
Type | Description |
---|---|
Bunch |
The rotations, speed and capacities of the network. |
vrp_rep
¶
fetch_vrp_rep(name, instance=None, return_raw=True)
¶
Fetches data sets from VRP-REP.
Usage for getting a VRPTW instance is:
bunch = fetch_vrp_rep(
"solomon-1987-r1", instance="R101_025"
)
name, n, e, c, d, Q, t, a, b, x, y = bunch["instance"]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str |
String identifier of the dataset. Can contain multiple instances |
required |
instance |
str |
String identifier of the instance. If |
None |
return_raw |
|
If |
True |
Returns:
Type | Description |
---|---|
Bunch |
Network information. |