Skip to content

Multiple Zone Systems Design

Ben Stabler edited this page Feb 3, 2017 · 57 revisions

Overview

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.

Input Data

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 skim matrix files
* (OTAP, DTAP, TIMEPERIOD) multiple TAP to TAP skim matrix files

NetworkLOS Queries

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
Can park and ride at TAPs nLOS.get_tap(TAP,"CANPNR") tap vector, "CANPNR" attribute returns a vector of can park and ride for the TAP vector
MAZ has transit access nLOS.get_maz(TAP,"HASTRANSIT") maz vector, "HASTRANSIT" attribute returns a vector of MAZ has transit access for the MAZ vector
TAZ attribute 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, timeperiod vector, "TIME" measure returns a vector of travel times for taz pairs
Travel distance between MAZ pairs nLOS.get_mazpairs(OMAZ,DMAZ,"DISTANCE") omaz vector, dmaz vector, "DISTANCE" measure returns a vector of travel distances for maz pairs
Travel distance between MAZ-TAP pairs nLOS.get_maztappairs(OMAZ,DTAP,"DISTANCE") omaz vector, dtap vector, "DISTANCE" measure returns a vector of travel distances for maz-tap pairs
Travel times between TAP pairs nLOS.get_tappairs(OTAP,DTAP,"TIME") otap vector, dtap 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 tuple 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,"BEST") omaz vector, dmaz vector, "BEST" criteria returns a tuple of tap pairs (boarding tap, alighting tap) for maz pairs

Transit Virtual Path Building

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 the following costs:

  • OMAZ to BTAP attributes such as distance
  • BTAP attributes such as station quality
  • BTAP to ATAP attributes such as travel time
  • ATAP attributes such as station quality
  • ATAP to DMAZ attributes such as distance

For the prototype, a simply vectorized algorithm for selecting the best tap pair is as follows:

# Step 1 - get nearby boarding TAPs
omaz_btap_table = nLOS.get_taps_mazs(OMAZ)

# Step 2 - get nearby alighting TAPs
dmaz_atap_table = nLOS.get_taps_mazs(DMAZ)

# Step 3 - merge into one 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,"DISTANCE")
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")
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,"DISTANCE")

# Step 5 - calculate utility 
omaz_btap_atap_dmaz_table.totalcost = omaz_btap_cost + btap_cost + btap_atap_cost + atap_cost + dmaz_atap_cost

# Step 5 - select best
grouped = omaz_btap_atap_dmaz_table.grouby([omaz,mdaz])
grouped['totalcost'].idxmin()

#Step 6 - get best btap and atap for each MAZ pair

SANDAG Specific File Conversions

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 (< 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 ( > 2 mi)

Clone this wiki locally