Skip to content

Commit

Permalink
Merge pull request #51 from MetropolitanTransportationCommission/fares
Browse files Browse the repository at this point in the history
Adds fares to path enumeration and additive fares to labeling and pathfinding.
Note that adding fares adds significant (4X) processing time.
  • Loading branch information
e-lo committed Feb 9, 2017
2 parents 5fda532 + 457a7cd commit fb38017
Show file tree
Hide file tree
Showing 69 changed files with 3,066 additions and 921 deletions.
Binary file added Examples/OverlapExample/OverlapExampleCosts.xlsx
Binary file not shown.
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/agency.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
agency_id,agency_name,agency_url,agency_timezone
TNT,TestNetTransit,http://www.sftca.org,US/Pacific
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/calendar.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
service_id,monday ,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
TNT,1,1,1,1,1,1,1,20150101,20151231
18 changes: 18 additions & 0 deletions Examples/OverlapExample/input/config_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# configuration for fasttrips
[fasttrips]
max_iterations = 1
simulation = True
output_passenger_trajectories = True
create_skims = False
prepend_route_id_to_trip_id = True
capacity_constraint = False
trace_person_ids = ['frogger']
number_of_processes = 1
bump_buffer = 5
debug_output_columns = True

[pathfinding]
stochastic_pathset_size = 1000
time_window = 30
overlap_variable = time
overlap_split_transit = True
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/fare_attributes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fare_id,price,currency_type,payment_method,transfers
default_fare_id,0.05,USD,0,0
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/fare_attributes_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fare_period,price,currency_type,payment_method,transfers,transfer_duration
default_fare_id_allday,1.00,USD,0,0,
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/fare_periods_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fare_id,fare_period,start_time,end_time
default_fare_id,default_fare_id_allday,00:00:00,24:00:00
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/fare_rules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fare_id,route_id
default_fare_id,Bus
default_fare_id,LR
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/household.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hh_id,hh_vehicles,hh_income,hh_size,hh_workers,hh_presch,hh_grdsch,hh_hghsch,hh_elders
zorn,0,666,3,2,0,0,0,0
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/node_coords.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
N,Y,X
ZO,37.76342,-122.49867
ZD,37.76776,-122.46790
10 changes: 10 additions & 0 deletions Examples/OverlapExample/input/pathweight_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
user_class purpose demand_mode_type demand_mode supply_mode weight_name weight_value
all fun transfer transfer transfer walk_time_min 1.0
all fun transfer transfer transfer transfer_penalty 6.0
all fun access walk walk_access time_min 2.0
all fun access walk walk_access preferred_delay_min 2.0
all fun egress walk walk_egress time_min 2.0
all fun transit transit local_bus in_vehicle_time_min 1.1
all fun transit transit local_bus wait_time_min 2.0
all fun transit transit light_rail in_vehicle_time_min 1.0
all fun transit transit light_rail wait_time_min 2.0
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/person.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
person_id,hh_id,age,gender,worker_status,work_athome,multiple_jobs,transit_pass,disability
frogger,zorn,21,female,part-time,True,True,False,walker
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/routes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
route_id,route_short_name,route_long_name,route_type
Bus,Bus,Local Bus,3
LR,LightRail,Light Rail,0
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/routes_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
route_id,mode,proof_of_payment
Bus,local_bus,FALSE
LR,light_rail,TRUE
6 changes: 6 additions & 0 deletions Examples/OverlapExample/input/shapes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence
B,37.76467,-122.49601,1
B,37.76586,-122.46974,2
B,37.76603,-122.46425,3
LR,37.76084,-122.49923,1
LR,37.76216,-122.46683,2
6 changes: 6 additions & 0 deletions Examples/OverlapExample/input/stop_times.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trip_id,arrival_time,departure_time,stop_id,stop_sequence
bus_trip1,15:00:00,15:01:00,S1,1
bus_trip1,15:10:00,15:11:00,S2,2
bus_trip1,15:15:00,15:16:00,S3,3
lr_trip1,15:02:00,15:02:00,L1,1
lr_trip1,15:09:00,15:09:00,L2,2
6 changes: 6 additions & 0 deletions Examples/OverlapExample/input/stop_times_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
trip_id,stop_id
bus_trip1,S1
bus_trip1,S2
bus_trip1,S3
lr_trip1,L1
lr_trip1,L2
6 changes: 6 additions & 0 deletions Examples/OverlapExample/input/stops.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stop_id,stop_name,stop_lat,stop_lon,zone_id
S1,BusStop1,37.76467,-122.49601,
S2,BusStop2,37.76586,-122.46974,
S3,BusStop3,37.76603,-122.46425,
L1,LightRailStop1,37.76084,-122.49923,
L2,LightRailStop2,37.76216,-122.46683,
6 changes: 6 additions & 0 deletions Examples/OverlapExample/input/stops_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stop_id
S1
S2
S3
L1
L2
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/taz_coords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
taz,lat,lon
ZO,37.76342,-122.49867
ZD,37.76776,-122.46790
Binary file added Examples/OverlapExample/input/test_network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Examples/OverlapExample/input/transfers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from_stop_id,to_stop_id,transfer_type,min_transfer_time
1 change: 1 addition & 0 deletions Examples/OverlapExample/input/transfers_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from_stop_id,to_stop_id,dist,from_route_id,to_route_id,elevation_gain,schedule_precedence
2 changes: 2 additions & 0 deletions Examples/OverlapExample/input/trip_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
person_id,person_trip_id,o_taz,d_taz,mode,purpose,departure_time,arrival_time,time_target,vot,pnr_ids
frogger,0,ZO,ZD,transit,fun,14:59:00,15:30:00,departure,25.50,
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/trips.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trip_id,route_id,service_id,direction_id,shape_id
bus_trip1,Bus,TNT,1,B
lr_trip1,LR,TNT,1,LR
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/trips_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
trip_id,vehicle_name
bus_trip1,bus
lr_trip1,light_rail
3 changes: 3 additions & 0 deletions Examples/OverlapExample/input/vehicles_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vehicle_name,seated_capacity,standing_capacity
bus,5,5
light_rail,8,8
6 changes: 6 additions & 0 deletions Examples/OverlapExample/input/walk_access_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
taz,stop_id,direction,dist
ZO,S1,access,0.02
ZO,L1,access,0.02
ZD,S2,egress,0.35
ZD,S3,egress,0.2125
ZD,L2,egress,0.3725
4 changes: 2 additions & 2 deletions Examples/test_network/demand_reg/trip_list.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
person_id,person_trip_id,o_taz,d_taz,mode,purpose,departure_time,arrival_time,time_target,vot,pnr_ids
0,trip_1,Z4,Z3,transit,other,15:15:00,15:45:00,departure,24.90245502,
tracey,trip_2,Z4,Z2,transit,work,15:15:10,15:45:10,departure,1.519007606,
0,trip_2,Z4,Z2,transit,work,15:15:10,15:45:10,departure,1.519007606,
0,trip_3,Z3,Z4,transit,work,15:15:20,15:45:20,arrival,6.753424044,
0,trip_4,Z2,Z5,transit,other,15:15:30,15:45:30,departure,24.8322348,
0,trip_5,Z4,Z5,transit,other,15:15:40,15:45:40,departure,6.562409062,
Expand Down Expand Up @@ -33,7 +33,7 @@ tracey,trip_2,Z4,Z2,transit,work,15:15:10,15:45:10,departure,1.519007606,
0,trip_32,Z4,Z2,transit,other,15:20:10,15:50:10,arrival,23.12517166,
0,trip_33,Z5,Z4,transit,work,15:20:20,15:50:20,departure,16.96017715,
0,trip_34,Z5,Z1,transit,work,15:20:30,15:50:30,departure,18.86787727,
0,trip_35,Z1,Z5,transit,work,15:20:40,15:50:40,departure,2.764604956,
tracey,trip_35,Z1,Z5,transit,work,15:20:40,15:50:40,departure,2.764604956,
0,trip_36,Z3,Z2,transit,work,15:20:50,15:50:50,departure,3.27871576,
0,trip_37,Z5,Z3,transit,other,15:21:00,15:51:00,departure,22.0510083,
0,trip_38,Z3,Z2,transit,work,15:21:10,15:51:10,departure,9.463091919,
Expand Down
6 changes: 4 additions & 2 deletions Examples/test_network/input/fare_attributes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
fare_id,price,currency_type,payment_method,transfers
bus_local_fare_id,2,USD,0,0
bus_express_fare_id,3,USD,0,0
rail_fare_id,4,USD,1,0
bus_local_b1_b3_id,2.25,USD,0,2
rail_fare_id,4,USD,1,0
b3_to_b1_fare_id,2.22,USD,0,0
default_fare_id,0.05,USD,0,0
14 changes: 10 additions & 4 deletions Examples/test_network/input/fare_attributes_ft.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
fare_class,price,currency_type,payment_method,transfers
bus_local_fare_class,2,USD,0,0
bus_express_fare_class,3,USD,0,0
rail_fare_class,4,USD,1,0
fare_period,price,currency_type,payment_method,transfers,transfer_duration
bus_local_fare_default,2,USD,0,0,
bus_local_fare_am,2.5,USD,0,0,
bus_local_fare_pm,2.75,USD,0,0,
bus_local_b1_b3_id_allday,2.25,USD,0,2,
bus_express_fare_class,3,USD,0,0,
rail_fare_class,4,USD,1,1,620
b3_to_b1_fare_am,2.44,USD,0,0,
b3_to_b1_fare_pm,2.66,USD,0,0,
default_fare_id_allday,0.10,USD,0,0,
9 changes: 9 additions & 0 deletions Examples/test_network/input/fare_periods_ft.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fare_id,fare_period,start_time,end_time
bus_local_fare_id,bus_local_fare_default,default,default
bus_local_fare_id,bus_local_fare_am,06:00:00,09:00:00
bus_local_fare_id,bus_local_fare_pm,13:00:00,17:00:00
bus_local_b1_b3_id,bus_local_b1_b3_id_allday,00:00:00,24:00:00
rail_fare_id,rail_fare_class,default,default
b3_to_b1_fare_id,b3_to_b1_fare_am,00:00:00,12:00:00
b3_to_b1_fare_id,b3_to_b1_fare_pm,12:00:00,24:00:00
default_fare_id,default_fare_id_allday,00:00:00,24:00:00
12 changes: 7 additions & 5 deletions Examples/test_network/input/fare_rules.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
fare_id,route_id
bus_local_fare_id,A
bus_express_fare_id,B
rail_fare_id,C

fare_id,route_id,origin_id,destination_id
bus_local_fare_id,A,,
bus_local_b1_b3_id,A,B1_zone,B3_zone
rail_fare_id,C,,
b3_to_b1_fare_id,,B3_zone,B1_zone
bus_local_fare_id,D,,
default_fare_id,,,
4 changes: 0 additions & 4 deletions Examples/test_network/input/fare_rules_ft.txt

This file was deleted.

11 changes: 4 additions & 7 deletions Examples/test_network/input/fare_transfer_rules_ft.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
from_fare_class,to_fare_class,is_flat_fee,transfer_rule
bus_local_fare_class,bus_express_fare_class,TRUE,2.5
bus_local_fare_class,rail_fare_class,TRUE,3.5
bus_express_fare_class,bus_local_fare_class,TRUE,1.5
bus_express_fare_class,rail_fare_class,TRUE,3.5
rail_fare_class,bus_local_fare_class,TRUE,1.5
rail_fare_class,bus_express_fare_class,TRUE,2.5
from_fare_period,to_fare_period,transfer_fare_type,transfer_fare
bus_local_fare_pm,rail_fare_class,transfer_cost,0.55
bus_local_fare_default,rail_fare_class,transfer_discount,0.50
rail_fare_class,bus_local_fare_pm,transfer_free,1.00
2 changes: 2 additions & 0 deletions Examples/test_network/input/node_coords.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Z2,-122.459305,37.786905
Z3,-122.476170,37.782224
Z4,-122.477372,37.776763
Z5,-122.471750,37.770183
B0,-122.487990,37.779996
B1,-122.484665,37.780138
B2,-122.472314,37.780689
B3,-122.458932,37.781241
B4,-122.456371,37.781551
R1,-122.472648,37.786397
R2,-122.472314,37.780689
R3,-122.471829,37.773182
1 change: 1 addition & 0 deletions Examples/test_network/input/routes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ route_id,route_short_name,route_long_name,route_type
A,Bus_A_Loc,Local Bus - A,3
B,Bus_B_Exp,Express Bus- B,3
C,Rail_C,Rail - C Line,2
D,Shuttle,Local Shuttle,3
10 changes: 5 additions & 5 deletions Examples/test_network/input/routes_ft.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
route_id,mode,fare_class,proof_of_payment
A,local_bus,bus_local_fare_class,FALSE
B,rapid_bus,bus_express_fare_class,FALSE
C,heavy_rail,rail_fare_class,TRUE

route_id,mode,proof_of_payment
A,local_bus,FALSE
B,rapid_bus,FALSE
C,heavy_rail,TRUE
D,local_bus,FALSE
10 changes: 7 additions & 3 deletions Examples/test_network/input/shapes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence
A,37.7801330597,-122.484651775,1
A,37.7811123617,-122.471682117,2
A,37.7812360582,-122.458918779,3
A,37.7799960000,-122.487990000,1
A,37.7801330597,-122.484651775,2
A,37.7811123617,-122.471682117,3
A,37.7812360582,-122.458918779,4
A,37.7815518000,-122.456371100,5
B,37.7801330597,-122.484651775,1
B,37.7812360582,-122.458918779,2
C,37.7731770600,-122.471815778,1
C,37.7806840588,-122.472300777,2
C,37.7863920587,-122.472634777,3
D,37.7806840588,-122.472300777,1
D,37.7863920587,-122.472634777,2
Loading

0 comments on commit fb38017

Please sign in to comment.