-
Notifications
You must be signed in to change notification settings - Fork 99
Multiple Zone Systems Design
The SANDAG CT-RAMP model has three zone systems: MAZs, TAZs, and TAPs. ActivitySim currently supports only one zone system. In addition, the skims
object supports only TAZ to TAZ skims. In order to support multiple zone systems, the skims object will be re-imagined as something more like a NetworkLOS
object. The NetworkLOS object will allow the user to read multiple types of network level-of-service data and then query it in vectorized form.
NetworkLOS will support two types of inputs: pandas DataFrames in an HDF5 file and skim matrices in an OMX file.
The inputs to the NetworkLOS object will be:
- NetworkData.HDF5
Table | Primary Key(s) | Foreign Key(s) | Notes |
---|---|---|---|
TAZ | ZONE | TAZ data; additional optional attributes | |
MAZ | ZONE | TAZ | MAZ data; additional optional attributes; nest within TAZs |
TAP | ZONE | MAZ | TAP data; additional optional attributes; point within an MAZ |
MAZtoMAZ | (OMAZ, DMAZ, MODE) | MAZ to nearby MAZs data; additional optional attributes | |
MAZtoTAP | (MAZ, TAP, MODE) | MAZ to nearby TAPs data; additional optional attributes |
- OMX skim matrix files
Files | Primary Key(s) | Foreign Key(s) | Notes |
---|---|---|---|
* | (OTAZ, DTAZ, TIMEPERIOD) | multiple TAZ to TAZ skims per file and multiple files possible | |
* | (OTAP, DTAP, TIMEPERIOD) | multiple TAP to TAP skims per file and multiple files possible |
All NetworkLOS queries are vectorized, i.e. they take vector arguments and return vectors. The NetworkLOS query interface will be revised to support expressions such as:
Query | Example | Arguments | Notes |
---|---|---|---|
Attributes | |||
Get TAZ for TAPs | nLOS.get_tap(TAP,"TAZ") |
tap vector, "TAZ" attribute | returns a vector of TAZ for the TAP vector |
Get MAZ for TAPs | nLOS.get_tap(TAP,"MAZ") |
tap vector, "MAZ" attribute | returns a vector of MAZ for the TAP vector |
Get TAZ for MAZs | nLOS.get_maz(MAZ,"TAZ") |
maz vector, "TAZ" attribute | returns a vector of TAZ for the MAZ vector |
Get an optional attribute of TAPs | nLOS.get_tap(TAP, "CANPNR") |
tap vector, "CANPNR" attribute | returns a vector of can park and ride for the TAP vector |
Get an optional attribute of MAZs | nLOS.get_maz(TAP, "HASTRANSIT") |
maz vector, "HASTRANSIT" attribute | returns a vector of MAZ has transit access for the MAZ vector |
Get an optional attribute of TAZs | nLOS.get_taz(TAZ, "XXXXX") |
taz vector, "XXXXX" attribute | returns a vector of XXXXX for the TAZ vector |
OD data | |||
Travel time between TAZ pairs | nLOS.get_tazpairs(OTAZ,DTAZ, TIMEPERIOD,"TIME") |
otaz vector, dtaz vector, time period vector, "TIME" measure | returns a vector of travel times for taz pairs |
Travel distance between MAZ pairs | nLOS.get_mazpairs(OMAZ,DMAZ, MODE,"DISTANCE") |
omaz vector, dmaz vector, mode vector, "DISTANCE" measure | returns a vector of travel distances for maz pairs |
Travel distance between MAZ-TAP pairs | nLOS.get_maztappairs(OMAZ,DTAP, MODE,"DISTANCE") |
omaz vector, dtap vector, mode vector, "DISTANCE" measure | returns a vector of travel distances for maz-tap pairs |
Travel times between TAP pairs | nLOS.get_tappairs(OTAP,DTAP, TIMEPERIOD, "TIME") |
otap vector, dtap vector, time period vector, "TIME" measure | returns a vector of travel times for tap pairs |
Ragged Arrays | |||
Nearby TAPs for MAZs | nLOS.get_taps_mazs(OMAZ, "DISTANCE") |
omaz vector, optional "DISTANCE" measure | returns a table of (maz, tap, distance) for all mazs to all nearby taps; should be sorted by distance if desired |
Transit Virtual Path Building | |||
Best TAP pairs for MAZ pairs | nLOS.get_tappairs_mazpairs(OMAZ,DMAZ, TIMEPERIOD,"BEST") |
omaz vector, dmaz vector, time period vector, "BEST" criteria | returns a tuple of tap pairs (boarding tap, alighting tap) for maz pairs |
The transit virtual path builder (TVPB) selects the best tap pairs for a given OMAZ and DMAZ given a user specified transit path utility that combines five elements:
- OMAZ to BTAP attributes (such as travel time)
- BTAP attributes (such as station quality (in the form of equivalent minutes))
- BTAP to ATAP attributes (such as travel time)
- ATAP attributes (such as station quality (in the form of equivalent minutes))
- ATAP to DMAZ attributes (such as travel time)
For the prototype, a simple vectorized algorithm for selecting the best tap pair might look something like:
# Step 1 - get nearby boarding TAPs to origin
omaz_btap_table = nLOS.get_taps_mazs(OMAZ)
# Step 2 - get nearby alighting TAPs to destination
dmaz_atap_table = nLOS.get_taps_mazs(DMAZ)
# Step 3 - merge into one big pandas table with all boarding and alighting combinations
omaz_btap_atap_dmaz_table = ...
# Step 4 - get data for each path leg
omaz_btap_atap_dmaz_table.omaz_btap_cost = nLOS.get_maztappairs(OMAZ,BTAP,MODE,"TIME")
omaz_btap_atap_dmaz_table.btap_cost = nLOS.get_tap(BTAP,"QUALITY")
omaz_btap_atap_dmaz_table.btap_atap_cost = nLOS.get_tappairs(BTAP,ATAP,TIME,"TIME")
omaz_btap_atap_dmaz_table.atap_cost = nLOS.get_tap(ATAP,"QUALITY")
omaz_btap_atap_dmaz_table.dmaz_atap_cost = nLOS.get_maztappairs(DMAZ,ATAP,MODE,"TIME")
# Step 5 - calculate total utility
omaz_btap_atap_dmaz_table.totalcost = omaz_btap_cost + btap_cost +
btap_atap_cost + atap_cost + dmaz_atap_cost
# Step 6 - select best and return (btap,atap) tuple for each MAZ pair
grouped = omaz_btap_atap_dmaz_table.grouby([omaz,mdaz])
grouped['totalcost'].idxmin()
The SANDAG input files will be converted via a Python script into the formats expected by NetworkLOS as follows:
- NetworkData.HDF5:
- bikeMgraLogsum.csv - MAZ to MAZ table (bike logsums for OD pairs < 2mi)
- walkMgraTapEquivMinutes.csv - MAZ to TAP table
- walkMgraEquivMinutes.csv - MAZ to MAZ table
- mgra_based_input2012.csv - MAZ table
- Accessam.csv - convert from TAZ to TAP to MAZ to TAP table
- Tap_ptye.csv - TAP table
- Zone_term.csv - TAZ table
- Zone_park.csv - TAZ table
- bikeTazLogsum.csv - converted to a TAZ to TAZ OMX skim instead (bike logsums for OD pairs > 2 mi)