uxsim.TaxiHandler.TaxiHandler.TaxiHandler¶
- class uxsim.TaxiHandler.TaxiHandler.TaxiHandler(W)[source]¶
A base class for handling the assignment of trip requests to taxis (or ridesourcing, ridehailing, ridesharing, robot-taxi, shared mobility, whatever).
Initializes a taxi handler.
- Parameters:
W (World) – The world object.
Methods
__init__
(W)Initializes a taxi handler.
add_trip_request
(orig, dest, depart_time[, ...])Adds a trip request to this handler.
assign_taxi
(vehicle, trip_request)Assigns a trip request to a vehicle.
Converts the basic statistics on taxi travels to a pandas DataFrame.
Computes basic statistics of the taxi travels.
get_trip
(tr)Get a TripRequest instance by name or object.
Prints the basic statistics.
Converts the trips and their travel records to a pandas DataFrame.
- add_trip_request(orig, dest, depart_time, name=None, attribute=None)[source]¶
Adds a trip request to this handler.
- Parameters:
orig (str | Node) – The origin node of the trip request.
dest (str | Node) – The destination node of the trip request.
depart_time (float) – The time at which the trip request departs.
name (any, optional) – The name of the trip request. Default is None.
attribute (any) – An optional attribute of the trip request. This can be used to store any information by users’ need.
- assign_taxi(vehicle, trip_request)[source]¶
Assigns a trip request to a vehicle.
- Parameters:
vehicle (Vehicle) – The vehicle to assign the trip request to.
- get_trip(tr)[source]¶
Get a TripRequest instance by name or object.
- Parameters:
tr (any | TripRequest) – The name or object of the trip request.