Skip to content

Commit

Permalink
Merge pull request #126 from SANDAG/ABM3_develop_mt_tod
Browse files Browse the repository at this point in the history
Add time-of-day constraints to microtransit and NEV
  • Loading branch information
JoeJimFlood authored Apr 22, 2024
2 parents 713e439 + 50c7584 commit 436d8bd
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 111 deletions.
4 changes: 4 additions & 0 deletions src/asim/configs/common/constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,17 @@ microtransitWaitTime: 12
microtransitMaxDist: 4.5
microtransitDiversionConstant: 5
microtransitDiversionFactor: 1.25
microtransitStartPeriod: 9
microtransitEndPeriod: 32
nevSpeed: 17
nevCost: 125 #cents
nevWaitTime: 12
nevMaxDist: 3
nevDwellMinutesPerMile: 0.5
nevDiversionConstant: 5
nevDiversionFactor: 1.25
nevStartPeriod: 9
nevEndPeriod: 38
maxWalkIfMTAccessAvailable: 0.5 # Maximum distance to walk to premium transit if microtransit access is available

# cost of "average" monthly transit pass cost. Used in transit pass ownership model.
Expand Down
4 changes: 4 additions & 0 deletions src/asim/configs/crossborder/constants.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,15 @@ microtransitWaitTime: 12
microtransitMaxDist: 4.5
microtransitDiversionConstant: 5
microtransitDiversionFactor: 1.25
microtransitStartPeriod: 9
microtransitEndPeriod: 32
nevSpeed: 17
nevCost: 125 #cents
nevWaitTime: 12
nevMaxDist: 3
nevDwellMinutesPerMile: 0.5
nevDiversionConstant: 5
nevDiversionFactor: 1.25
nevStartPeriod: 9
nevEndPeriod: 38
maxWalkIfMTAccessAvailable: 0.5 # Maximum distance to walk to premium transit if microtransit access is available
Original file line number Diff line number Diff line change
Expand Up @@ -108,51 +108,53 @@ vot-indexed skims,da_dist_skims,((odt_skims['SOV_NT_L_DIST'] * (_vot_bin_da == 1
# Microtransit and NEV,,
microtransit available at origin,microtransit_orig,"reindex(land_use.microtransit, df[orig_col_name])"
microtransit available at destination,microtransit_dest,"reindex(land_use.microtransit, df[dest_col_name])"
microtransit available,microtransit_available,(microtransit_orig > 0) & (microtransit_orig == microtransit_dest) & (s3_dist_skims < microtransitMaxDist)
microtransit operating at time of trip,microtransit_operating,(depart >= microtransitStartPeriod) & (depart <= microtransitEndPeriod)
microtransit available,microtransit_available,(microtransit_orig > 0) & (microtransit_orig == microtransit_dest) & (s3_dist_skims < microtransitMaxDist) & microtransit_operating
microtransit direct time,microtransit_direct_time,"np.maximum(s3_dist_skims/microtransitSpeed*60, s3_time_skims)"
microtransit total time,microtransit_time,"np.maximum(microtransit_direct_time + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_time)"
nev available at origin,nev_orig,"reindex(land_use.nev, df[orig_col_name])"
nev available at destination,nev_dest,"reindex(land_use.nev, df[dest_col_name])"
nev available,nev_available,(nev_orig > 0) & (nev_orig == nev_dest) & (s3_dist_skims < nevMaxDist)
nev operating at time of trip,nev_operating,(depart >= nevStartPeriod) & (depart <= nevEndPeriod)
nev available,nev_available,(nev_orig > 0) & (nev_orig == nev_dest) & (s3_dist_skims < nevMaxDist) & nev_operating
nev direct time,nev_direct_time,"np.maximum(s3_dist_skims/nevSpeed*60, s3_time_skims)"
nev total time,nev_time,"np.maximum(nev_direct_time + nevDiversionConstant, nevDiversionFactor*nev_direct_time)"
# Microtransit and NEV egress from transit,,
outbound microtransit egress from premium available,microtransit_local_egress_available_out,df.outbound & (microtransit_dest>0) & (dest_micro_local_dist>maxWalkIfMTAccessAvailable) & (dest_micro_local_dist<microtransitMaxDist)
outbound microtransit egress from premium available,microtransit_local_egress_available_out,df.outbound & (microtransit_dest>0) & (dest_micro_local_dist>maxWalkIfMTAccessAvailable) & (dest_micro_local_dist<microtransitMaxDist) & microtransit_operating
outbound microtransit direct egress from premium time,microtransit_direct_local_egress_time_out,"np.maximum(dest_micro_local_dist/microtransitSpeed*60, odt_skims['TNCOUT_LOC_EGR'])"
outbound microtransit egress from premium time,microtransit_local_egress_time_out,"microtransitWaitTime + np.maximum(microtransit_direct_local_egress_time_out + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_local_egress_time_out)"
inbound microtransit access to premium available,microtransit_local_access_available_in,~df.outbound & (microtransit_orig>0) & (origin_micro_local_dist>maxWalkIfMTAccessAvailable) & (origin_micro_local_dist<microtransitMaxDist)
inbound microtransit access to premium available,microtransit_local_access_available_in,~df.outbound & (microtransit_orig>0) & (origin_micro_local_dist>maxWalkIfMTAccessAvailable) & (origin_micro_local_dist<microtransitMaxDist) & microtransit_operating
inbound microtransit direct access to premium time,microtransit_direct_local_access_time_in,"np.maximum(origin_micro_local_dist/microtransitSpeed*60, odt_skims['TNCOUT_LOC_ACC'])"
inbound microtransit access to premium time,microtransit_local_access_time_in,"microtransitWaitTime + np.maximum(microtransit_direct_local_access_time_in + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_local_access_time_in)"
outbound nev egress from premium available,nev_local_egress_available_out,df.outbound & (nev_dest>0) & (dest_micro_local_dist>maxWalkIfMTAccessAvailable) & (dest_micro_local_dist<nevMaxDist)
outbound nev egress from premium available,nev_local_egress_available_out,df.outbound & (nev_dest>0) & (dest_micro_local_dist>maxWalkIfMTAccessAvailable) & (dest_micro_local_dist<nevMaxDist) & nev_operating
outbound nev direct egress from premium time,nev_direct_local_egress_time_out,"np.maximum(dest_micro_local_dist/nevSpeed*60, odt_skims['TNCOUT_LOC_EGR'])"
outbound nev egress from premium time,nev_local_egress_time_out,"nevWaitTime + np.maximum(nev_direct_local_egress_time_out + microtransitDiversionConstant, microtransitDiversionFactor*nev_direct_local_egress_time_out)"
inbound nev access to premium available,nev_local_access_available_in,~df.outbound & (nev_orig>0) & (origin_micro_local_dist>maxWalkIfMTAccessAvailable) & (origin_micro_local_dist<nevMaxDist)
inbound nev access to premium available,nev_local_access_available_in,~df.outbound & (nev_orig>0) & (origin_micro_local_dist>maxWalkIfMTAccessAvailable) & (origin_micro_local_dist<nevMaxDist) & nev_operating
inbound nev direct access to premium time,nev_direct_local_access_time_in,"np.maximum(origin_micro_local_dist/nevSpeed*60, odt_skims['TNCOUT_LOC_ACC'])"
inbound nev access to premium time,nev_local_access_time_in,"nevWaitTime + np.maximum(nev_direct_local_access_time_in + microtransitDiversionConstant, microtransitDiversionFactor*nev_direct_local_access_time_in)"
#,,
outbound microtransit egress from premium available,microtransit_prm_egress_available_out,df.outbound & (microtransit_dest>0) & (dest_micro_prm_dist>maxWalkIfMTAccessAvailable) & (dest_micro_prm_dist<microtransitMaxDist)
outbound microtransit egress from premium available,microtransit_prm_egress_available_out,df.outbound & (microtransit_dest>0) & (dest_micro_prm_dist>maxWalkIfMTAccessAvailable) & (dest_micro_prm_dist<microtransitMaxDist) & microtransit_operating
outbound microtransit direct egress from premium time,microtransit_direct_prm_egress_time_out,"np.maximum(dest_micro_prm_dist/microtransitSpeed*60, odt_skims['TNCOUT_PRM_EGR'])"
outbound microtransit egress from premium time,microtransit_prm_egress_time_out,"microtransitWaitTime + np.maximum(microtransit_direct_prm_egress_time_out + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_prm_egress_time_out)"
inbound microtransit access to premium available,microtransit_prm_access_available_in,~df.outbound & (microtransit_orig>0) & (origin_micro_prm_dist>maxWalkIfMTAccessAvailable) & (origin_micro_prm_dist<microtransitMaxDist)
inbound microtransit access to premium available,microtransit_prm_access_available_in,~df.outbound & (microtransit_orig>0) & (origin_micro_prm_dist>maxWalkIfMTAccessAvailable) & (origin_micro_prm_dist<microtransitMaxDist) & microtransit_operating
inbound microtransit direct access to premium time,microtransit_direct_prm_access_time_in,"np.maximum(origin_micro_prm_dist/microtransitSpeed*60, odt_skims['TNCOUT_PRM_ACC'])"
inbound microtransit access to premium time,microtransit_prm_access_time_in,"microtransitWaitTime + np.maximum(microtransit_direct_prm_access_time_in + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_prm_access_time_in)"
outbound nev egress from premium available,nev_prm_egress_available_out,df.outbound & (nev_dest>0) & (dest_micro_prm_dist>maxWalkIfMTAccessAvailable) & (dest_micro_prm_dist<nevMaxDist)
outbound nev egress from premium available,nev_prm_egress_available_out,df.outbound & (nev_dest>0) & (dest_micro_prm_dist>maxWalkIfMTAccessAvailable) & (dest_micro_prm_dist<nevMaxDist) & nev_operating
outbound nev direct egress from premium time,nev_direct_prm_egress_time_out,"np.maximum(dest_micro_prm_dist/nevSpeed*60, odt_skims['TNCOUT_PRM_EGR'])"
outbound nev egress from premium time,nev_prm_egress_time_out,"nevWaitTime + np.maximum(nev_direct_prm_egress_time_out + microtransitDiversionConstant, microtransitDiversionFactor*nev_direct_prm_egress_time_out)"
inbound nev access to premium available,nev_prm_access_available_in,~df.outbound & (nev_orig>0) & (origin_micro_prm_dist>maxWalkIfMTAccessAvailable) & (origin_micro_prm_dist<nevMaxDist)
inbound nev access to premium available,nev_prm_access_available_in,~df.outbound & (nev_orig>0) & (origin_micro_prm_dist>maxWalkIfMTAccessAvailable) & (origin_micro_prm_dist<nevMaxDist) & nev_operating
inbound nev direct access to premium time,nev_direct_prm_access_time_in,"np.maximum(origin_micro_prm_dist/nevSpeed*60, odt_skims['TNCOUT_PRM_ACC'])"
inbound nev access to premium time,nev_prm_access_time_in,"nevWaitTime + np.maximum(nev_direct_prm_access_time_in + microtransitDiversionConstant, microtransitDiversionFactor*nev_direct_prm_access_time_in)"
#,,
outbound microtransit egress from premium available,microtransit_mix_egress_available_out,df.outbound & (microtransit_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<microtransitMaxDist)
outbound microtransit egress from premium available,microtransit_mix_egress_available_out,df.outbound & (microtransit_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<microtransitMaxDist) & microtransit_operating
outbound microtransit direct egress from premium time,microtransit_direct_mix_egress_time_out,"np.maximum(dest_micro_mix_dist/microtransitSpeed*60, odt_skims['TNCOUT_MIX_EGR'])"
outbound microtransit egress from premium time,microtransit_mix_egress_time_out,"microtransitWaitTime + np.maximum(microtransit_direct_mix_egress_time_out + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_mix_egress_time_out)"
inbound microtransit access to premium available,microtransit_mix_access_available_in,~df.outbound & (microtransit_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<microtransitMaxDist)
inbound microtransit access to premium available,microtransit_mix_access_available_in,~df.outbound & (microtransit_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<microtransitMaxDist) & microtransit_operating
inbound microtransit direct access to premium time,microtransit_direct_mix_access_time_in,"np.maximum(origin_micro_mix_dist/microtransitSpeed*60, odt_skims['TNCOUT_MIX_ACC'])"
inbound microtransit access to premium time,microtransit_mix_access_time_in,"microtransitWaitTime + np.maximum(microtransit_direct_mix_access_time_in + microtransitDiversionConstant, microtransitDiversionFactor*microtransit_direct_mix_access_time_in)"
outbound nev egress from premium available,nev_mix_egress_available_out,df.outbound & (nev_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<nevMaxDist)
outbound nev egress from premium available,nev_mix_egress_available_out,df.outbound & (nev_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<nevMaxDist) & nev_operating
outbound nev direct egress from premium time,nev_direct_mix_egress_time_out,"np.maximum(dest_micro_mix_dist/nevSpeed*60, odt_skims['TNCOUT_MIX_EGR'])"
outbound nev egress from premium time,nev_mix_egress_time_out,"nevWaitTime + np.maximum(nev_direct_mix_egress_time_out + microtransitDiversionConstant, microtransitDiversionFactor*nev_direct_mix_egress_time_out)"
inbound nev access to premium available,nev_mix_access_available_in,~df.outbound & (nev_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<nevMaxDist)
inbound nev access to premium available,nev_mix_access_available_in,~df.outbound & (nev_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<nevMaxDist) & nev_operating
inbound nev direct access to premium time,nev_direct_mix_access_time_in,"np.maximum(origin_micro_mix_dist/nevSpeed*60, odt_skims['TNCOUT_MIX_ACC'])"
inbound nev access to premium time,nev_mix_access_time_in,"nevWaitTime + np.maximum(nev_direct_mix_access_time_in + microtransitDiversionConstant, microtransitDiversionFactor*nev_direct_mix_access_time_in)"
# Additional transfers from microtransit and NEV,,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,17 @@ Description,Target,Expression
,s3_dist_skims,((odt_skims['HOV3_L_DIST'] * (vot_bin_s3 == 1)) + (odt_skims['HOV3_M_DIST'] * (vot_bin_s3 == 2)) + (odt_skims['HOV3_H_DIST'] * (vot_bin_s3 == 3)))
microtransit available at origin,microtransit_orig,"reindex(land_use.microtransit, trips.origin)"
microtransit available at destination,microtransit_dest,"reindex(land_use.microtransit, trips.destination)"
microtransit available,microtransit_available,(microtransit_orig > 0) & (microtransit_orig == microtransit_dest) & (s3_dist_skims < microtransitMaxDist)
microtransit operating at time of trip,microtransit_operating,(depart >= microtransitStartPeriod) & (depart <= microtransitEndPeriod)
microtransit available,microtransit_available,(microtransit_orig > 0) & (microtransit_orig == microtransit_dest) & (s3_dist_skims < microtransitMaxDist) & microtransit_operating
nev available at origin,nev_orig,"reindex(land_use.nev, trips.origin)"
nev available at destination,nev_dest,"reindex(land_use.nev, trips.destination)"
nev available,nev_available,(nev_orig > 0) & (nev_orig == nev_dest) & (s3_dist_skims < nevMaxDist)
outbound microtransit access available,microtransit_access_available_out,trips.outbound & (microtransit_orig>0) & (origin_micro_mix_dist<microtransitMaxDist)
outbound nev access available,nev_access_available_out,trips.outbound & (nev_orig>0) & (origin_micro_mix_dist<nevMaxDist)
outbound microtransit egress available,microtransit_egress_available_out,trips.outbound & (microtransit_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<microtransitMaxDist)
outbound nev egress available,nev_egress_available_out,trips.outbound & (nev_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<nevMaxDist)
inbound microtransit access available,microtransit_access_available_in,~trips.outbound & (microtransit_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<microtransitMaxDist)
inbound nev access available,nev_access_available_in,~trips.outbound & (nev_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<nevMaxDist)
inbound microtransit egress available,microtransit_egress_available_in,~trips.outbound & (microtransit_dest>0) & (dest_micro_mix_dist<microtransitMaxDist)
inbound nev egress available,nev_egress_available_in,~trips.outbound & (nev_dest>0) & (dest_micro_mix_dist<nevMaxDist)
nev operating at time of trip,nev_operating,(depart >= nevStartPeriod) & (depart <= nevEndPeriod)
nev available,nev_available,(nev_orig > 0) & (nev_orig == nev_dest) & (s3_dist_skims < nevMaxDist) & nev_operating
outbound microtransit access available,microtransit_access_available_out,trips.outbound & (microtransit_orig>0) & (origin_micro_mix_dist<microtransitMaxDist) & microtransit_operating
outbound nev access available,nev_access_available_out,trips.outbound & (nev_orig>0) & (origin_micro_mix_dist<nevMaxDist) & nev_operating
outbound microtransit egress available,microtransit_egress_available_out,trips.outbound & (microtransit_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<microtransitMaxDist) & microtransit_operating
outbound nev egress available,nev_egress_available_out,trips.outbound & (nev_dest>0) & (dest_micro_mix_dist>maxWalkIfMTAccessAvailable) & (dest_micro_mix_dist<nevMaxDist) & nev_operating
inbound microtransit access available,microtransit_access_available_in,~trips.outbound & (microtransit_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<microtransitMaxDist) & microtransit_operating
inbound nev access available,nev_access_available_in,~trips.outbound & (nev_orig>0) & (origin_micro_mix_dist>maxWalkIfMTAccessAvailable) & (origin_micro_mix_dist<nevMaxDist) & nev_operating
inbound microtransit egress available,microtransit_egress_available_in,~trips.outbound & (microtransit_dest>0) & (dest_micro_mix_dist<microtransitMaxDist) & microtransit_operating
inbound nev egress available,nev_egress_available_in,~trips.outbound & (nev_dest>0) & (dest_micro_mix_dist<nevMaxDist) & nev_operating
Loading

0 comments on commit 436d8bd

Please sign in to comment.