("mf%i193", "mf%i198"), ("mf%i194", "mf%i199"), ("mf%i195", "mf%i200")]) #sov pay hwy_skims.extend([("mf%i211", "mf%i216"), ("mf%i212", "mf%i217"), ("mf%i213", "mf%i218"), ("mf%i214", "mf%i219"), ("mf%i215", "mf%i220")]) #hov2 pay hwy_skims.extend([("mf%i231", "mf%i236"), ("mf%i232", "mf%i237"), ("mf%i233", "mf%i238"), ("mf%i234", "mf%i239"), ("mf%i235", "mf%i240")]) #hov3+ pay for aMat_lo, aMat_hi in hwy_skims: id_lo = m.emmebank.matrix(aMat_lo % (tod)).id id_hi = m.emmebank.matrix(aMat_hi % (tod)).id mfs_tod.append([id_lo, id_hi]) # Calculate high/low averages and write to ZMX format (using ID of low-income matrix) for mf_lo, mf_hi in mfs_tod: mat_avg, zoneNames = EMXtoZMX.avgMf(m.emmebank, mf_lo, mf_hi, scen) EMXtoZMX.writeZMX(emxFolder + "\\" + mf_lo + ".zmx", zoneNames, mat_avg) ########################################################################## # TRANSIT ########################################################################## #transit skimming #%1% /transit scenario 100 for base year #%2% /time-of-day period and highway network 1-8 #%3% /number of iterations for transit assignment equilibration #%4% /matrix number for conventional transit demand for initial assignment #%5% /matrix number for premium transit demand for initial assignment #%6% /1=bypass conventional transit assignment and skims; 0=skim both conv and prem #%7% /1=Bypass create matrix segmentation by class; 0=create demand matrices by class
hwy_skims = [] mfs_tod = [] hwy_skims.extend([("mf%i181","mf%i186"),("mf%i182","mf%i187"),("mf%i183","mf%i188"),("mf%i185","mf%i190")]) #sov hwy_skims.extend([("mf%i201","mf%i206"),("mf%i202","mf%i207"),("mf%i203","mf%i208"),("mf%i205","mf%i210")]) #hov2 hwy_skims.extend([("mf%i221","mf%i226"),("mf%i222","mf%i227"),("mf%i223","mf%i228"),("mf%i225","mf%i230")]) #hov3+ hwy_skims.extend([("mf%i191","mf%i196"),("mf%i192","mf%i197"),("mf%i193","mf%i198"),("mf%i194","mf%i199"),("mf%i195","mf%i200")]) #sov pay hwy_skims.extend([("mf%i211","mf%i216"),("mf%i212","mf%i217"),("mf%i213","mf%i218"),("mf%i214","mf%i219"),("mf%i215","mf%i220")]) #hov2 pay hwy_skims.extend([("mf%i231","mf%i236"),("mf%i232","mf%i237"),("mf%i233","mf%i238"),("mf%i234","mf%i239"),("mf%i235","mf%i240")]) #hov3+ pay for aMat_lo, aMat_hi in hwy_skims: id_lo = m.emmebank.matrix(aMat_lo % (tod)).id id_hi = m.emmebank.matrix(aMat_hi % (tod)).id mfs_tod.append([id_lo, id_hi]) # Calculate high/low averages and write to ZMX format (using ID of low-income matrix) for mf_lo, mf_hi in mfs_tod: mat_avg, zoneNames = EMXtoZMX.avgMf(m.emmebank, mf_lo, mf_hi, scen) EMXtoZMX.writeZMX(emxFolder + "\\" + mf_lo + ".zmx", zoneNames, mat_avg) ########################################################################## # TRANSIT ########################################################################## #transit skimming #%1% /transit scenario 100 for base year #%2% /time-of-day period and highway network 1-8 #%3% /number of iterations for transit assignment equilibration #%4% /matrix number for conventional transit demand for initial assignment #%5% /matrix number for premium transit demand for initial assignment #%6% /1=bypass conventional transit assignment and skims; 0=skim both conv and prem #%7% /1=Bypass create matrix segmentation by class; 0=create demand matrices by class mfConvDem = tod*1000 + matNumConvDemand
#run only specified periods runPeriod = runPeriods[i] if runPeriod: scen = highwayScenarios[i] tranScen = transitScenarios[i] tod = tods[i] #read taz and tap demand matrices and write to bank matNames = ["mf%i123","mf%i124","mf%i125","mf%i126","mf%i127","mf%i128","mf%i129","mf%i130","mf%i131","mf%i132","mf%i133","mf%i134"] #taz mfs_tod = [] for aMat in matNames: mfs_tod.append(aMat % (tod)) for mf in mfs_tod: mat, zoneNames, name = EMXtoZMX.readZMX("outputs\\" + mf + ".zmx") EMXtoZMX.setMf(m.emmebank, mat, name) print("Load highway matrix into databank %s" % (name)) if not runTransitOnly: #highwy assign and skim with new demand #%1% /0 - initialize split matrices mf131-mf174, 1 - start with the previous set #%2% /MSA factor for averaging matrices 0-1 (0-no update, 1.0 full update) #%3% /0 - skip final assign., 1 - implement final assign. (last global iter.) #%4% /base scenario for assignment (9999 - for skimming) #%5% /number of assignment iterations #%6% /0 - include auto split, 1 - exclude (when applied with CT-RAMP) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 1.00, 0, scen, 25, 1), m.emmebank.path, scen) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 0.75, 0, scen, 50, 1), m.emmebank.path, scen) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 0.50, 0, scen, 75, 1), m.emmebank.path, scen) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 0.25, 1, scen, 100, 1), m.emmebank.path, scen)
#run only specified periods runPeriod = runPeriods[i] if runPeriod: scen = highwayScenarios[i] tranScen = transitScenarios[i] tod = tods[i] #read taz and tap demand matrices and write to bank matNames = ["mf%i123","mf%i124","mf%i125","mf%i126","mf%i127","mf%i128","mf%i129","mf%i130","mf%i131","mf%i132","mf%i133","mf%i134"] #taz mfs_tod = [] for aMat in matNames: mfs_tod.append(aMat % (tod)) for mf in mfs_tod: mat, zoneNames, name = EMXtoZMX.readZMX("outputs\\" + mf + ".zmx") EMXtoZMX.setMf(m.emmebank, mat, name) print("Load highway matrix into databank %s" % (name)) if not runTransitOnly: #highwy assign and skim with new demand #%1% /0 - initialize split matrices mf131-mf174, 1 - start with the previous set #%2% /MSA factor for averaging matrices 0-1 (0-no update, 1.0 full update) #%3% /0 - skip final assign., 1 - implement final assign. (last global iter.) #%4% /base scenario for assignment (9999 - for skimming) #%5% /number of assignment iterations #%6% /0 - include auto split, 1 - exclude (when applied with CT-RAMP) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 1.00, 0, scen, 50, 1), m.emmebank.path, scen) #p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 0.75, 0, scen, 50, 1), m.emmebank.path, scen) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 0.667, 0, scen, 75, 1), m.emmebank.path, scen) p.run_macro("~< %s %i %f %i %i %i %i" % (hwySkimMacro, 1, 0.333, 1, scen, 100, 1), m.emmebank.path, scen)