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_df and person information in Passenger.persons_df, which are both pandas.DataFrame instances.

__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 two pandas.DataFrame instances.

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_ID

Households column: Household ID

INPUT_HOUSEHOLDS_FILE

File with households

INPUT_PERSONS_FILE

File with persons

INPUT_TRIP_LIST_FILE

File with trip list

MIN_VALUE_OF_TIME

Minumum Value of Time: 1 dollar shouldn't be worth 180 minutes

MODE_GENERIC_TRANSIT

Generic transit.

MODE_GENERIC_TRANSIT_NUM

Generic transit - Numeric mode number

PATHSET_LINKS_CSV

PATHSET_PATHS_CSV

results - PathSets

PERSONS_COLUMN_HOUSEHOLD_ID

Persons column: Household ID

PERSONS_COLUMN_PERSON_ID

Persons column: Person ID (string)

PERSONS_COLUMN_PERSON_ID_NUM

Persons column: Person ID number

PF_COL_DESCRIPTION

path text description

PF_COL_LINK_COST

cost (generalized) path-finder thinks passenger spent on link

PF_COL_LINK_DIST

dist path-finder thinks passenger spent on link

PF_COL_LINK_FARE

fare path-finder thinks passenger spent on link

PF_COL_LINK_MODE

link mode (Access, Trip, Egress, etc)

PF_COL_LINK_NUM

link number, starting from access

PF_COL_LINK_TIME

time path-finder thinks passenger spent on link

PF_COL_MODE

supply mode

PF_COL_PATH_NUM

path number, starting from 0

PF_COL_PAX_A_TIME

time path-finder thinks passenger arrived at A

PF_COL_PAX_A_TIME_MIN

todo replace/rename ??

PF_COL_PAX_B_TIME

time path-finder thinks passenger arrived at B

PF_COL_PF_ITERATION

0.01*pathfinding_iteration + iteration during which this path was found

PF_COL_ROUTE_ID

link route ID

PF_COL_TRIP_ID

link trip ID

PF_COL_WAIT_TIME

time path-finder thinks passenger waited for vehicle on trip links

PF_LINKS_CSV

PF_PATHS_CSV

pathfinding results

TIME_TARGET_ARRIVAL

Option for Passenger.TRIP_LIST_COLUMN_TIME_TARGET (arrival time)

TIME_TARGET_DEPARTURE

Option for Passenger.TRIP_LIST_COLUMN_TIME_TARGET (departure time)

TRIP_LIST_COLUMN_ACCESS_MODE

Trip list column: Access Mode

TRIP_LIST_COLUMN_ARRIVAL_TIME

Trip list column: Arrival Time.

TRIP_LIST_COLUMN_ARRIVAL_TIME_MIN

Trip list column: Departure Time.

TRIP_LIST_COLUMN_DEPARTURE_TIME

Trip list column: Departure Time.

TRIP_LIST_COLUMN_DEPARTURE_TIME_MIN

Trip list column: Departure Time.

TRIP_LIST_COLUMN_DESTINATION_TAZ_ID

Trip list column: Destination TAZ ID

TRIP_LIST_COLUMN_DESTINATION_TAZ_ID_NUM

Trip list column: Destination Numeric TAZ ID

TRIP_LIST_COLUMN_EGRESS_MODE

Trip list column: Egress Mode

TRIP_LIST_COLUMN_MODE

Trip list column: Mode

TRIP_LIST_COLUMN_ORIGIN_TAZ_ID

Trip list column: Origin TAZ ID

TRIP_LIST_COLUMN_ORIGIN_TAZ_ID_NUM

Trip list column: Origin TAZ Numeric ID

TRIP_LIST_COLUMN_OUTBOUND

Trip list column: Outbound (bool), true iff time target is arrival

TRIP_LIST_COLUMN_PERSON_ID

Trip list column: Person ID

TRIP_LIST_COLUMN_PERSON_TRIP_ID

Trip list column: Person Trip ID

TRIP_LIST_COLUMN_PURPOSE

Trip list column: Purpose.

TRIP_LIST_COLUMN_TIME_TARGET

Trip list column: Time Target (either 'arrival' or 'departure')

TRIP_LIST_COLUMN_TRACE

Trip list column: Trace.

TRIP_LIST_COLUMN_TRANSIT_MODE

Trip list column: Transit Mode

TRIP_LIST_COLUMN_TRIP_LIST_ID_NUM

Trip list column: Unique numeric ID for this passenger/trip

TRIP_LIST_COLUMN_USER_CLASS

Trip list column: User class.

TRIP_LIST_COLUMN_VOT

Trip list column: Value of time.

id_to_pathset

Maps trip_list_id to PathSet instance.