fasttrips.Passenger
- class fasttrips.Passenger(input_dir, output_dir, today, stops, routes, capacity_constraint)[source]
Passenger class.
One instance represents all of the households and persons that could potentially make transit trips.
Stores household information in
Passenger.households_dfand person information inPassenger.persons_df, which are bothpandas.DataFrameinstances.- __init__(input_dir, output_dir, today, stops, routes, capacity_constraint)[source]
Constructor from dictionary mapping attribute to value.
Methods
__init__(input_dir, output_dir, today, ...)Constructor from dictionary mapping attribute to value.
add_pathset(trip_list_id, pathset)Stores this path set for the trip_list_id.
choose_paths(choose_for_everyone, iteration, ...)Returns the same dataframes as input, but with a new/updated column,
Assignment.SIM_COL_PAX_CHOSEN.clean_pathset_dfs(pathset_paths_df, ...)get_chosen_links(pathset_links_df[, ...])Given the pathset paths and pathset links, returns the pathset links for the ones marked as chosen.
get_id_columns(is_skimming)get_pathset(trip_list_id)Retrieves a stored path set for the given trip_list_id
get_person_id(trip_list_id)process_path(pathnum, pathset, pathset_id, ...)process_path_state(pathnum, pathset, ...[, ...])read_passenger_pathsets(pathset_dir, stops, ...)Reads the dataframes described in
Passenger.setup_passenger_pathsets()and returns them.setup_passenger_pathsets(iteration, ...)Converts pathfinding results (which is stored in each Passenger
PathSet) into twopandas.DataFrameinstances.setup_pathsets_generic(pathset_dict, ...[, ...])write_paths(output_dir, iteration, ...)Write either pathset paths (if links=False) or pathset links (if links=True) as the case may be
Attributes
HOUSEHOLDS_COLUMN_HOUSEHOLD_IDHouseholds column: Household ID
INPUT_HOUSEHOLDS_FILEFile with households
INPUT_PERSONS_FILEFile with persons
INPUT_TRIP_LIST_FILEFile with trip list
MIN_VALUE_OF_TIMEMinumum Value of Time: 1 dollar shouldn't be worth 180 minutes
MODE_GENERIC_TRANSITGeneric transit.
MODE_GENERIC_TRANSIT_NUMGeneric transit - Numeric mode number
PATHSET_LINKS_CSVPATHSET_PATHS_CSVresults - PathSets
PERSONS_COLUMN_HOUSEHOLD_IDPersons column: Household ID
PERSONS_COLUMN_PERSON_IDPersons column: Person ID (string)
PERSONS_COLUMN_PERSON_ID_NUMPersons column: Person ID number
PF_COL_DESCRIPTIONpath text description
PF_COL_LINK_COSTcost (generalized) path-finder thinks passenger spent on link
PF_COL_LINK_DISTdist path-finder thinks passenger spent on link
PF_COL_LINK_FAREfare path-finder thinks passenger spent on link
PF_COL_LINK_MODElink mode (Access, Trip, Egress, etc)
PF_COL_LINK_NUMlink number, starting from access
PF_COL_LINK_TIMEtime path-finder thinks passenger spent on link
PF_COL_MODEsupply mode
PF_COL_PATH_NUMpath number, starting from 0
PF_COL_PAX_A_TIMEtime path-finder thinks passenger arrived at A
PF_COL_PAX_A_TIME_MINtodo replace/rename ??
PF_COL_PAX_B_TIMEtime path-finder thinks passenger arrived at B
PF_COL_PF_ITERATION0.01*pathfinding_iteration + iteration during which this path was found
PF_COL_ROUTE_IDlink route ID
PF_COL_TRIP_IDlink trip ID
PF_COL_WAIT_TIMEtime path-finder thinks passenger waited for vehicle on trip links
PF_LINKS_CSVPF_PATHS_CSVpathfinding results
TIME_TARGET_ARRIVALOption for
Passenger.TRIP_LIST_COLUMN_TIME_TARGET(arrival time)TIME_TARGET_DEPARTUREOption for
Passenger.TRIP_LIST_COLUMN_TIME_TARGET(departure time)TRIP_LIST_COLUMN_ACCESS_MODETrip list column: Access Mode
TRIP_LIST_COLUMN_ARRIVAL_TIMETrip list column: Arrival Time.
TRIP_LIST_COLUMN_ARRIVAL_TIME_MINTrip list column: Departure Time.
TRIP_LIST_COLUMN_DEPARTURE_TIMETrip list column: Departure Time.
TRIP_LIST_COLUMN_DEPARTURE_TIME_MINTrip list column: Departure Time.
TRIP_LIST_COLUMN_DESTINATION_TAZ_IDTrip list column: Destination TAZ ID
TRIP_LIST_COLUMN_DESTINATION_TAZ_ID_NUMTrip list column: Destination Numeric TAZ ID
TRIP_LIST_COLUMN_EGRESS_MODETrip list column: Egress Mode
TRIP_LIST_COLUMN_MODETrip list column: Mode
TRIP_LIST_COLUMN_ORIGIN_TAZ_IDTrip list column: Origin TAZ ID
TRIP_LIST_COLUMN_ORIGIN_TAZ_ID_NUMTrip list column: Origin TAZ Numeric ID
TRIP_LIST_COLUMN_OUTBOUNDTrip list column: Outbound (bool), true iff time target is arrival
TRIP_LIST_COLUMN_PERSON_IDTrip list column: Person ID
TRIP_LIST_COLUMN_PERSON_TRIP_IDTrip list column: Person Trip ID
TRIP_LIST_COLUMN_PURPOSETrip list column: Purpose.
TRIP_LIST_COLUMN_TIME_TARGETTrip list column: Time Target (either 'arrival' or 'departure')
TRIP_LIST_COLUMN_TRACETrip list column: Trace.
TRIP_LIST_COLUMN_TRANSIT_MODETrip list column: Transit Mode
TRIP_LIST_COLUMN_TRIP_LIST_ID_NUMTrip list column: Unique numeric ID for this passenger/trip
TRIP_LIST_COLUMN_USER_CLASSTrip list column: User class.
TRIP_LIST_COLUMN_VOTTrip list column: Value of time.
id_to_pathsetMaps trip_list_id to
PathSetinstance.