fasttrips.PathSet
- class fasttrips.PathSet(trip_list_dict)[source]
Represents a path set for a passenger from an origin
TAZto a destinationTAZthrough a set of stops.Methods
__init__(trip_list_dict)Constructor from dictionary mapping attribute to value.
calculate_cost(STOCH_DISPERSION, ...[, ...])This is equivalent to the C++ Path::calculateCost() method.
calculate_overlap(pathset_links_to_use)Given a set of pathset links, returns a the results of overlap calculations.
goes_somewhere()Does this path go somewhere? Does the destination differ from the origin?
num_paths()Number of paths in the PathSet
path_found()Was a a transit path found from the origin to the destination with the constraints?
reset()Delete my states, something went wrong and it won't work out.
set_user_class(trip_list_df, new_colname)Adds a column called user_class by applying the configured user class function.
split_transit_links(pathset_links_df, ...)Splits the transit links to their component links and returns.
verify_weight_config(modes_df, output_dir, ...)Verify that we have complete weight configurations for the user classes and modes in the given DataFrame.
verify_weights(weights)write_path_times(passengers_df, output_dir)Write the assigned path times to the given output file.
write_paths(passengers_df, output_dir)Write the assigned paths to the given output file.
Attributes
ARRIVE_LATE_ALLOWED_MINAllow departures and arrivals before / after preferred time
BUMP_EXPERIENCED_COSTBUMP_FLAG_COLUMNCONFIGURED_FUNCTIONSConfigured functions, indexed by name
CONSTANT_GROWTH_MODELDEPART_EARLY_ALLOWED_MINDIR_INBOUNDTrips inbound to home have preferred departure times
DIR_OUTBOUNDTrips outbound from home have preferred arrival times
EXP_GROWTH_MODELHUGE_COSTLEARN_ROUTESLEARN_ROUTES_RATELOGARITHMIC_GROWTH_MODELLOGISTIC_GROWTH_MODELMIN_TRANSFER_PENALTYConfiguration: Minimum transfer penalty.
OUTPUT_WEIGHTS_FILEFile with weights for c++
OVERLAP_CHUNK_SIZEOverlap chunk size.
OVERLAP_COUNTOverlap variable option: count.
OVERLAP_DISTANCEOverlap variable option: distance.
OVERLAP_NONEOverlap variable option: None.
OVERLAP_SCALE_PARAMETERConfiguration: Overlap scale parameter.
OVERLAP_SPLIT_TRANSITOverlap option: Split transit leg into component parts? e.g.
OVERLAP_TIMEOverlap variable option: time.
OVERLAP_VARIABLEConfiguration: Overlap variable.
OVERLAP_VARIABLE_OPTIONSValid values for OVERLAP_VARAIBLE
PATHS_OUTPUT_FILEPaths output file
PATH_KEY_COSTpath cost according to pathfinder
PATH_KEY_FAREpath fare according to pathfinder
PATH_KEY_INIT_COSTinitial cost (in pathfinding, before path was finalized)
PATH_KEY_INIT_FAREinitial fare (in pathfinding, before path was finalized)
PATH_KEY_PROBABILITYpath probability according to pathfinder
PATH_KEY_STATESPATH_TIMES_OUTPUT_FILEPath times output file
PENALTY_GROWTH_MODELSSTATE_IDX_ARRDEPdatetime.datetimeinstance.STATE_IDX_COSTcost float, for hyperpath/stochastic assignment
STATE_IDX_DEPARRdatetime.datetimeinstance.STATE_IDX_DEPARRMODEmode id
STATE_IDX_LABELdatetime.timedeltainstanceSTATE_IDX_LINKCOSTlink generalized cost, float for hyperpath/stochastic,
STATE_IDX_LINKDISTlink distance, float
STATE_IDX_LINKFAREfare cost, float
STATE_IDX_LINKTIMEdatetime.timedeltainstanceSTATE_IDX_SEQsequence (for trip)
STATE_IDX_SEQ_SUCCPREDsequence for successor/predecessor
STATE_IDX_SUCCPREDstop identifier or TAZ identifier
STATE_IDX_TRIPtrip id
STATE_MODE_ACCESSSTATE_MODE_EGRESSSTATE_MODE_TRANSFERSTATE_MODE_TRIPSUCCESS_FLAG_COLUMNUSER_CLASS_FUNCTIONPath configuration: Name of the function that defines user class
WEIGHTS_COLUMN_DEMAND_MODEWeights column: Demand Mode Type
WEIGHTS_COLUMN_DEMAND_MODE_TYPEWeights column: Demand Mode Type
WEIGHTS_COLUMN_PURPOSEWeights column: Purpose
WEIGHTS_COLUMN_SUPPLY_MODEWeights column: Supply Mode
WEIGHTS_COLUMN_SUPPLY_MODE_NUMWeights column: Supply Mode number
WEIGHTS_COLUMN_USER_CLASSWeights column: User Class
WEIGHTS_COLUMN_WEIGHT_NAMEWeights column: Weight Name
WEIGHTS_COLUMN_WEIGHT_VALUEWeights column: Weight Value
WEIGHTS_DFPath weights
WEIGHTS_FILEFile with weights file.
WEIGHTS_FIXED_WIDTHRead weights file as fixed-width format.
WEIGHTS_GROWTH_LOGISTIC_MAXWeights column: Max value for logistic growth function
WEIGHTS_GROWTH_LOGISTIC_MIDWeights column: Midpoint value for logistic growth function
WEIGHTS_GROWTH_LOG_BASEWeights column: Log Base for logarithmic growth function
WEIGHTS_GROWTH_TYPEWeights column: Growth Type
WEIGHT_NAME_ARRIVE_EARLY_MINWEIGHT_NAME_ARRIVE_LATE_MINWEIGHT_NAME_DEPART_EARLY_MINWEIGHT_NAME_DEPART_LATE_MINWEIGHT_NAME_VALID_NAMESpathdictDict of path-num -> { cost:, probability:, states: [List of (stop_id, stop_state)]}