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.

__init__(W)[source]

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.

basic_to_pandas()

Converts the basic statistics on taxi travels to a pandas DataFrame.

compute_stats()

Computes basic statistics of the taxi travels.

get_trip(tr)

Get a TripRequest instance by name or object.

print_stats()

Prints the basic statistics.

trips_to_pandas()

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.

basic_to_pandas()[source]

Converts the basic statistics on taxi travels to a pandas DataFrame.

compute_stats()[source]

Computes basic statistics of the taxi travels.

get_trip(tr)[source]

Get a TripRequest instance by name or object.

Parameters:

tr (any | TripRequest) – The name or object of the trip request.

print_stats()[source]

Prints the basic statistics.

trips_to_pandas()[source]

Converts the trips and their travel records to a pandas DataFrame.