Data Structures
The module contains the data structures FleetState
and VehicleState
depend on.
Requests
- class TransportationRequest(request_id, creation_timestamp, origin, destination, pickup_timewindow_min=0, pickup_timewindow_max=inf, delivery_timewindow_min=0, delivery_timewindow_max=inf)[source]
A request for the system to perform a transportation task, through creating a route through the system given spatio-temporal constraints.
LocType
- class LocType(value)[source]
Represents the kind of location objects the simulator supports. Either of:
R2LOC
(for points in \(\mathbb{R}^2\), holds aTuple[float, float]
).INT
(for e.g. graphs).
Note
Use this for simulations using the pure python components. For simulations using cythonic components, the cython version of this enum i.e.
data_structures_cython.LocType
has to be used.
Stop and Stoplist
- class StopAction(value)[source]
Representing actions that the system may perform at a specific location
The TransportSpace
and Dispatcher
interfaces
- class TransportSpace[source]
-
- abstract interp_time(u, v, time_to_dest)[source]
Interpolate a location
x
between the originu
and the destinationv
as a function of the travel time between the unknown location and the destinationt(x, v) == time_to_dest
.- Parameters:
u – origin coordinate
v – destination coordinate
time_to_dest – travel time from the unknown location
x
to the destinationv
- Returns:
x – interpolated coordinate of the unknown location
x
jump_dist – remaining distance until the returned interpolated coordinate will be reached
- Return type:
Note
The notion of
jump_dist
is necessary in transport spaces whose locations are discrete (e.g. graphs). There if someone is travelling along a trajectory, at a certain timet
one may be “in between” two locationsw
andx
. Then the “position” at timet
is ill defined, and we must settle for the fact that its location will bex
att+jump_time
.
- abstract interp_dist(origin, destination, dist_to_dest)[source]
Interpolate a location
x
between the originu
and the destinationv
as a function of the distance between the unknown location and the destinationd(x, v) == dist_to_dest
.- Parameters:
u – origin coordinate
v – destination coordinate
dist_to_dest – distance from the unknown location
x
to the destinationv
- Returns:
x – interpolated coordinate of the unknown location
x
jump_dist – remaining distance until the returned interpolated coordinate will be reached
- Return type:
Note
This is only the abstract base class specifying the interface. Actual
TransportSpace
classes are available in util.spaces
.
- SingleVehicleSolution
- vehicle_id, cost, (
pickup_timewindow_min, pickup_timewindow_max, delivery_timewindow_min, delivery_timewindow_max,
)
This is what
VehicleState.handle_transportation_request_single_vehicle
returns. In case no solution is found, the cost is \(\infty\) and the timewindow variables areNone
.
- Dispatcher
Defines the
Dispatcher
interface. Actual dispatchers are implemented inutil.dispatchers
.alias of
Callable
[[TransportationRequest
,List
[Stop
],TransportSpace
,int
],tuple
[float
,List
[Stop
],tuple
[float
,float
,float
,float
]]]