在公共交通延误函数中使用动态仿真的公交车行驶时间进行公共交通分配

技术注解 #8

2015年1月

想象一下,你已经运行了一个动态仿真(中观、微观或混合),为你提供准确的公共交通车辆行驶时间,其中考虑到了拥堵、专用车道、信号灯和公共交通优先算法。 在宏观的公共交通分配中,利用这些信息对站与站之间的旅行时间进行更准确的估计不是很好吗?

多亏了Aimsun提供的综合建模环境,这才得以实现。 你只需编写一个公共交通延迟函数,从动态仿真产生的时间序列中读取公交车行驶时间。


公共交通分配

例子:

costCol = None
def pdf( context, line, ptsection ):
	global costCol
	if costCol == None:
		model = ptsection.getModel()
		vehicleType = model.getType("GKVehicle")
		vehicleId = model.getCatalog().findByName("Bus", vehicleType).getId()
		costCol = model.getColumn("DYNAMIC::SRC_GKSection_travelTime_%i" % vehicleId)
	res = 0.0
	fromStop = ptsection.getMaster().getOrigin()
	if fromStop != None:
		sectionLength = fromSection.length2D()
		fromSection = fromStop.getSection()
		fromFraction = (sectionLength - fromStop.getPosition()) / sectionLength
	else:
		fromSection = None
	toStop = ptsection.getMaster().getDestination()
	if toStop != None:
		toSection = toStop.getSection()
		toFraction = toStop.getPosition() / toSection.length2D()
	else:
		toSection = None
	for section in ptsection.getMaster().getRoute():
		fraction = 1.0
		if fromSection != None and section.getId() == fromSection.getId():
			fraction = fromFraction
		elif toSection != None and section.getId() == toSection.getId():
			fraction = toFraction
		ts = section.getDataValueTS(costCol)
		if ts != None:
			res += ts.getAggregatedValue()/60 * fraction
	if res == 0.0:
		print "No dynamic cost for PT Section %i" % ptsection.getId()
		res = 60.0 * ptsection.getDistance()/1000.0 / 20.0 #km/h
	return res
 

该函数从路段中读取公交车辆类型的最后一次仿真行驶时间,由于公交分配的成本是针对公交路段表示的,即针对站与站之间的区段,它把站与站之间的所有路段加起来,根据站点的位置,计算出第一和最后一个部分路段。

这种方法的一个重要应用是估计对公共交通系统的运行变化对交通分布和出行模式划分的影响,例如沿走廊引入信号优先和专用车道。

更多技术说明

  • 有问题吗? 请联系我们。

    我们在这里提供帮助!

  • 有问题吗? 请联系我们。

    我们在这里提供帮助!

分享

引用Aimsun Next

Aimsun Next 20

Aimsun (2021). Aimsun Next 20 User's Manual, Aimsun Next Version 20.0.3, Barcelona, Spain. Accessed on: May. 1, 2021. [In software].
Available: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html


Aimsun Next 8.4

Aimsun (2021). Aimsun Next 8.4 User's Manual, Aimsun Next Version 8.4.4, Barcelona, Spain. Accessed on: May. 1, 2021. [In software]. Available: qthelp://aimsun.com.aimsun.8.4/doc/UsersManual/Intro.html

Aimsun Next 20

@manual {​​​​​​​​AimsunManual,

title = {​​​​​​​​Aimsun Next 20 User's Manual}​​​​​​​​,

author = {​​​​​​​​Aimsun}​​​​​​​​,

edition = {​​​​​​​​​​​​​​​Aimsun Next 20.0.3}​​​​​​​​​​​​​​​,

address = {​​​​​​​​​​​​​​​Barcelona, Spain}​​​​​​​​​​​​​​​,

year = {​​​​​​​​​​​​​​​2021. [In software]}​​​​​​​​​​​​​​​,

month = {​​​​​​​​​​​​​​​Accessed on: Month, Day, Year}​​​​​​​​​​​​​​​,

url = {​​​​​​​​​​​​​​​qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html}​​​​​​​​​​​​​​​,

}​​​​​​​​​​​​​​​


Aimsun Next 8.4

@manual {​​​​​​​​AimsunManual,

title = {​​​​​​​​Aimsun Next 8.4 User's Manual}​​​​​​​​,

author = {​​​​​​​​Aimsun}​​​​​​​​,

edition = {​​​​​​​​​​​​​​​Aimsun Next 8.4.4}​​​​​​​​​​​​​​​,

address = {​​​​​​​​​​​​​​​Barcelona, Spain}​​​​​​​​​​​​​​​,

year = {​​​​​​​​​​​​​​​2021. [In software]}​​​​​​​​​​​​​​​,

month = {​​​​​​​​​​​​​​​Accessed on: Month, Day, Year}​​​​​​​​​​​​​​​,

url = {​​​​​​​​​​​​​​​qthelp://aimsun.com.aimsun.8.4/doc/UsersManual/Intro.html}​​​​​​​​​​​​​​​,

}​​​​​​​​​​​​​​​

Aimsun Next 20

TY - COMP

T1 - Aimsun Next 20 User's Manual

A1 - Aimsun

ET - Aimsun Next Version 20.0.3

Y1 - 2021

Y2 - Accessed on: Month, Day, Year

CY - Barcelona, Spain

PB - Aimsun

UR - [In software]. Available: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html


Aimsun Next 8.4

TY - COMP

T1 - Aimsun Next 8.4 User's Manual

A1 - Aimsun

ET - Aimsun Next Version 8.4.4

Y1 - 2021

Y2 - Accessed on: Month, Day, Year

CY - Barcelona, Spain

PB - Aimsun

UR - [In software]. Available: qthelp://aimsun.com.aimsun.8.4/doc/UsersManual/Intro.html