fasttrips.PathSet

class fasttrips.PathSet(trip_list_dict)[source]

Represents a path set for a passenger from an origin TAZ to a destination TAZ through a set of stops.

__init__(trip_list_dict)[source]

Constructor from dictionary mapping attribute to value.

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_MIN

Allow departures and arrivals before / after preferred time

BUMP_EXPERIENCED_COST

BUMP_FLAG_COLUMN

CONFIGURED_FUNCTIONS

Configured functions, indexed by name

CONSTANT_GROWTH_MODEL

DEPART_EARLY_ALLOWED_MIN

DIR_INBOUND

Trips inbound to home have preferred departure times

DIR_OUTBOUND

Trips outbound from home have preferred arrival times

EXP_GROWTH_MODEL

HUGE_COST

LEARN_ROUTES

LEARN_ROUTES_RATE

LOGARITHMIC_GROWTH_MODEL

LOGISTIC_GROWTH_MODEL

MIN_TRANSFER_PENALTY

Configuration: Minimum transfer penalty.

OUTPUT_WEIGHTS_FILE

File with weights for c++

OVERLAP_CHUNK_SIZE

Overlap chunk size.

OVERLAP_COUNT

Overlap variable option: count.

OVERLAP_DISTANCE

Overlap variable option: distance.

OVERLAP_NONE

Overlap variable option: None.

OVERLAP_SCALE_PARAMETER

Configuration: Overlap scale parameter.

OVERLAP_SPLIT_TRANSIT

Overlap option: Split transit leg into component parts? e.g.

OVERLAP_TIME

Overlap variable option: time.

OVERLAP_VARIABLE

Configuration: Overlap variable.

OVERLAP_VARIABLE_OPTIONS

Valid values for OVERLAP_VARAIBLE

PATHS_OUTPUT_FILE

Paths output file

PATH_KEY_COST

path cost according to pathfinder

PATH_KEY_FARE

path fare according to pathfinder

PATH_KEY_INIT_COST

initial cost (in pathfinding, before path was finalized)

PATH_KEY_INIT_FARE

initial fare (in pathfinding, before path was finalized)

PATH_KEY_PROBABILITY

path probability according to pathfinder

PATH_KEY_STATES

PATH_TIMES_OUTPUT_FILE

Path times output file

PENALTY_GROWTH_MODELS

STATE_IDX_ARRDEP

datetime.datetime instance.

STATE_IDX_COST

cost float, for hyperpath/stochastic assignment

STATE_IDX_DEPARR

datetime.datetime instance.

STATE_IDX_DEPARRMODE

mode id

STATE_IDX_LABEL

datetime.timedelta instance

STATE_IDX_LINKCOST

link generalized cost, float for hyperpath/stochastic,

STATE_IDX_LINKDIST

link distance, float

STATE_IDX_LINKFARE

fare cost, float

STATE_IDX_LINKTIME

datetime.timedelta instance

STATE_IDX_SEQ

sequence (for trip)

STATE_IDX_SEQ_SUCCPRED

sequence for successor/predecessor

STATE_IDX_SUCCPRED

stop identifier or TAZ identifier

STATE_IDX_TRIP

trip id

STATE_MODE_ACCESS

STATE_MODE_EGRESS

STATE_MODE_TRANSFER

STATE_MODE_TRIP

SUCCESS_FLAG_COLUMN

USER_CLASS_FUNCTION

Path configuration: Name of the function that defines user class

WEIGHTS_COLUMN_DEMAND_MODE

Weights column: Demand Mode Type

WEIGHTS_COLUMN_DEMAND_MODE_TYPE

Weights column: Demand Mode Type

WEIGHTS_COLUMN_PURPOSE

Weights column: Purpose

WEIGHTS_COLUMN_SUPPLY_MODE

Weights column: Supply Mode

WEIGHTS_COLUMN_SUPPLY_MODE_NUM

Weights column: Supply Mode number

WEIGHTS_COLUMN_USER_CLASS

Weights column: User Class

WEIGHTS_COLUMN_WEIGHT_NAME

Weights column: Weight Name

WEIGHTS_COLUMN_WEIGHT_VALUE

Weights column: Weight Value

WEIGHTS_DF

Path weights

WEIGHTS_FILE

File with weights file.

WEIGHTS_FIXED_WIDTH

Read weights file as fixed-width format.

WEIGHTS_GROWTH_LOGISTIC_MAX

Weights column: Max value for logistic growth function

WEIGHTS_GROWTH_LOGISTIC_MID

Weights column: Midpoint value for logistic growth function

WEIGHTS_GROWTH_LOG_BASE

Weights column: Log Base for logarithmic growth function

WEIGHTS_GROWTH_TYPE

Weights column: Growth Type

WEIGHT_NAME_ARRIVE_EARLY_MIN

WEIGHT_NAME_ARRIVE_LATE_MIN

WEIGHT_NAME_DEPART_EARLY_MIN

WEIGHT_NAME_DEPART_LATE_MIN

WEIGHT_NAME_VALID_NAMES

pathdict

Dict of path-num -> { cost:, probability:, states: [List of (stop_id, stop_state)]}