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.LocTypehas 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
xbetween the originuand the destinationvas 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
xto the destinationv
- Returns:
x – interpolated coordinate of the unknown location
xjump_dist – remaining distance until the returned interpolated coordinate will be reached
- Return type:
Note
The notion of
jump_distis necessary in transport spaces whose locations are discrete (e.g. graphs). There if someone is travelling along a trajectory, at a certain timetone may be “in between” two locationswandx. Then the “position” at timetis ill defined, and we must settle for the fact that its location will bexatt+jump_time.
- abstract interp_dist(origin, destination, dist_to_dest)[source]
Interpolate a location
xbetween the originuand the destinationvas 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
xto the destinationv
- Returns:
x – interpolated coordinate of the unknown location
xjump_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_vehiclereturns. In case no solution is found, the cost is \(\infty\) and the timewindow variables areNone.
- Dispatcher
Defines the
Dispatcherinterface. Actual dispatchers are implemented inutil.dispatchers.alias of
Callable[[TransportationRequest,List[Stop],TransportSpace,int],tuple[float,List[Stop],tuple[float,float,float,float]]]