Skip to content

Commit

Permalink
Rebased implementation for PAT Variation (Fast-Trips#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
Clint Daniels committed May 21, 2018
1 parent 6fcc714 commit d5d2036
Show file tree
Hide file tree
Showing 13 changed files with 886 additions and 35 deletions.
10 changes: 9 additions & 1 deletion fasttrips/Assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ def read_configuration(config_fullpath):
'number_of_processes' :0,
'bump_buffer' :5,
'bump_one_at_a_time' :'False',

# pathfinding
'max_num_paths' :-1,
'min_path_probability' :0.005,
Expand All @@ -317,7 +318,10 @@ def read_configuration(config_fullpath):
'time_window' :30,
'transfer_fare_ignore_pathfinding':'False',
'transfer_fare_ignore_pathenum' :'False',
'user_class_function' :'generic_user_class'
'user_class_function' :'generic_user_class',
'pat_variance' : 0,
'pat_penalty' : 1.01,
'pat_penalty_exp' : 'True',
})
# Read configuration from specified configuration directory
FastTripsLogger.info("Reading configuration file %s" % config_fullpath)
Expand Down Expand Up @@ -369,6 +373,10 @@ def read_configuration(config_fullpath):
Assignment.TRANSFER_FARE_IGNORE_PATHFINDING = parser.getboolean('pathfinding','transfer_fare_ignore_pathfinding')
Assignment.TRANSFER_FARE_IGNORE_PATHENUM = parser.getboolean('pathfinding','transfer_fare_ignore_pathenum')
PathSet.USER_CLASS_FUNCTION = parser.get ('pathfinding','user_class_function')
PathSet.PAT_VARIANCE = datetime.timedelta(
minutes = parser.getfloat ('fasttrips','pat_variance'))
PathSet.PAT_PENALTY = parser.getfloat ('fasttrips', 'pat_penalty')
PathSet.PAT_PENALTY_EXP = parser.getboolean('fasttrips', 'pat_penalty_exp')

if Assignment.PATHFINDING_TYPE not in [Assignment.PATHFINDING_TYPE_STOCHASTIC, \
Assignment.PATHFINDING_TYPE_DETERMINISTIC, \
Expand Down
31 changes: 31 additions & 0 deletions fasttrips/Examples/demand/demand_pat/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Fast-Trips Task 7
=================

Small Test Network - Test Demand
--------------------------------


Initial test demand includes trip information without associated HH or person info. As such `person_id` is
set to zero for all trips in the trip list. One trip occurs every 10 seconds on regular intervals. Each
trip has a random origin and a different random destination. If trips are evenly distributed the transit
network should be able to manage this level of demand, but some buses may fill. Demand starts at 3:15 PM
and ends at 5:15 PM. This means that there is a buffer time when transit will run without any demand at
the beginning and end of the test period. Fields and relevant explanations are explained below.

This variation also includes a arrival after / departure before preferred time.

trip_list.txt
-------------

Field | Type | Values | Notes
--------------|--------|---------------------|--------------------------------------------------------------------------------------------------------
person_id |str | |Emtpy for trips that are not associated with a person, start with simple dmd
o_taz |str |Z1-Z5 |I used str format for taz in network design, e.g. Z1, Z2, etc.
d_taz |str |Z1-Z5 |Same as otaz
mode |str |transit |Test net assumes user can choose any trn mode. Propose using single "transit" for initial test demand
purpose |str |work, other |For test net, just use "work" or "other"
departure_time|HH:MM:SS|15:00:00 to 17:30:00 |For test net, choose any time between 3:00p and 5:30p
arrival_time |HH:MM:SS|15:00:00 to 18:00:00 |For test net, set at departure time plus 30 minutes
time_target |str |arrival, departure |Randomly assign "arrival" or "departure"
vot |float |1 to 30 |VOT in $/hr, for test net choose random number between 1 and 30
pnr_ids | | |Optional, empty list implies any accessible PNR can be used
12 changes: 12 additions & 0 deletions fasttrips/Examples/demand/demand_pat/config_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[fasttrips]
network_build_date = 06/30/2015
trace_ids = [('tracey','trip_191')]
number_of_processes = 1
debug_output_columns = True

[pathfinding]
user_class_function = generic_user_class
pathweights_fixed_width = True
pat_variance = 10
pat_penalty = 1
pat_penalty_exp = True
31 changes: 31 additions & 0 deletions fasttrips/Examples/demand/demand_pat/pathweight_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
user_class purpose demand_mode_type demand_mode supply_mode weight_name weight_value
all other transfer transfer transfer walk_time_min 3.93
all other transfer transfer transfer transfer_penalty 47.73
all other access walk walk_access time_min 3.93
all other access walk walk_access pat_variance 4.0
all other egress walk walk_egress time_min 3.93
all other egress walk walk_egress pat_variance 4.0
all other transit transit local_bus in_vehicle_time_min 1.0
all other transit transit local_bus wait_time_min 1.77
all other transit transit rapid_bus in_vehicle_time_min 1.0
all other transit transit rapid_bus wait_time_min 1.77
all other transit transit heavy_rail in_vehicle_time_min 1.0
all other transit transit heavy_rail wait_time_min 1.77
all work transfer transfer transfer walk_time_min 3.93
all work transfer transfer transfer transfer_penalty 47.73
all work access walk walk_access time_min 3.93
all work access walk walk_access pat_variance 4.0
all work egress walk walk_egress time_min 3.93
all work egress walk walk_egress pat_variance 4.0
all work transit transit local_bus in_vehicle_time_min 1.0
all work transit transit local_bus wait_time_min 1.77
all work transit transit rapid_bus in_vehicle_time_min 1.0
all work transit transit rapid_bus wait_time_min 1.77
all work transit transit heavy_rail in_vehicle_time_min 1.0
all work transit transit heavy_rail wait_time_min 1.77
all work access PNR PNR_access walk_time_min 2.0
all work access PNR PNR_access drive_time_min 1.5
all work access PNR PNR_access pat_variance 4.0
all work egress PNR PNR_egress walk_time_min 2.0
all work egress PNR PNR_egress drive_time_min 1.5
all work egress PNR PNR_egress pat_variance 4.0
Loading

0 comments on commit d5d2036

Please sign in to comment.