当前位置: 首页 > news >正文

智能网站建设维护大庆建设网站

智能网站建设维护,大庆建设网站,关键词推广怎么做,深圳市信任网站Sumo中Traci.trafficlight详解#xff08;上#xff09; 记录慢慢学习traci的每一天#xff0c;希望也能帮到你 文章目录 Sumo中Traci.trafficlight详解#xff08;上#xff09;Traci.trafficlight信号灯参数讲解1.getAllProgramLogics(self,tlsID)2.getBlockingVehicle…Sumo中Traci.trafficlight详解上 记录慢慢学习traci的每一天希望也能帮到你 文章目录 Sumo中Traci.trafficlight详解上Traci.trafficlight信号灯参数讲解1.getAllProgramLogics(self,tlsID)2.getBlockingVehicles(self, tlsID, linkIndex)3.getConstraints(self, tlsID, tripId)4.getConstraintsByFoe(self, foeSignal, foeId)5.getControlledLanes(self, tlsID)6.getControlledLinks(self, tlsID)7.getNemaPhaseCalls(self, tlsID)8.getNextSwitch(self, tlsID)9.getPhase(self, tlsID) 、getPhaseDuration(self, tlsID)、getPhaseName(self, tlsID) Traci.trafficlight 导入库 import traci #这里不需要全部导入信号灯参数讲解 getAllProgramLogics(ID)输入为信号灯ID其中xml文件中对信号灯的定义方式如下 tlLogic id0 typestatic programID0 offset0phase duration31 stateGrGr/phase duration6 stateyryr/phase duration31 staterGrG/phase duration6 stateryry//tlLogic从上面可以得出第一个id为信号控制所在node的id信号灯的programID为‘0’当然这个id可以自己给定数据类型为字符串(str)控制类型为static即定时信号控制另外在sumo中还有其它的控制类型 可以自己多多尝试。duration为当前相位持续时间单位为s state为信号相位即通行权解释sumo的信号灯配置比较麻烦这里详细讲解一下 每一个state代表一个或者多个流线的放行如gggrrrrgggrrrr代表南北方向通行东西方向禁行g[0]g[1]g[2]r[3]r[4]r[5]r[6]按照索引位置进行对应。为了方便讲解这里以上面给的xml文件中的参数进行trafficlight的相关用法及返回值的讲解 tlLogic id0 typestatic programID0 offset0phase duration31 stateGrGr/phase duration6 stateyryr/phase duration31 staterGrG/phase duration6 stateryry//tlLogic1.getAllProgramLogics(self,tlsID) getAllProgramLogicsself tlsID getCompleteRedYellowGreenDefinition getAllProgramLogics(string) - list(Logic)返回值为元组数据,功能等同于getCompleteRedYellowGreenDefinition方法Returns a list of Logic objects.Each Logic encodes a traffic light program for the given tlsID. 返回逻辑对象的列表。每个逻辑为给定的tlsID编码一个红绿灯程序。traci.trafficlight.getAllProgramLogics( tlsID0) #(Logic(programID0, type0, currentPhaseIndex2, #phases(Phase(duration31.0, stateGrGr, minDur31.0, maxDur31.0, next()), #Phase(duration6.0, stateyryr, minDur6.0, maxDur6.0, next()), #Phase(duration31.0, staterGrG, minDur31.0, maxDur31.0, next()), #Phase(duration6.0, stateryry, minDur6.0, maxDur6.0, next())), subParameter{}),)通过getAllProgramLogics(self,tlsID)可以获得当前信号灯配时的全部信息。 2.getBlockingVehicles(self, tlsID, linkIndex) 输入为信号控制灯ID以及信号灯相位索引 getBlockingVehiclesself tlsID linkIndex getBlockingVehicles(string, int) - int Returns the list of vehicles that are blocking the subsequent block for the given tls-linkIndex 返回在信号交叉口阻塞的车辆ID列表代码如下示例 traci.trafficlight.getBlockingVehicles( tlsID0,0) #返回值为空表示没有阻塞车辆3.getConstraints(self, tlsID, tripId‘’) getConstraints(self, tlsID, tripId) getConstraintself tlsID tripId getConstraints(string, string) - list(Constraint) Returns the list of rail signal constraints for the given rail signal. If tripId is not , only constraints with the given tripId are returned. Otherwise, all constraints are returned 返回给定轨道信号的轨道信号约束列表。 如果tripId不为“”则只有具有给定tripId的约束为返回。否则将返回所有约束代码如下示例 traci.trafficlight.getConstraints( tlsID0,0) #针对轨道信号普通交叉口会报错4.getConstraintsByFoe(self, foeSignal, foeId‘’) getConstraintByFoeself foeSignal foeId getConstraintsByFoe(string, string) - list(Constraint) Returns the list of rail signal constraints that have the given rail signal id as their foeSignal. If foeId is not , only constraints with the given foeId are returned. Otherwise, all constraints are returned 返回具有给定轨道的轨道信号约束的列表信号id作为他们的foeSignal。 如果foeId不是“”则只有具有给定foeId的约束为返回。否则将返回所有约束traci.trafficlight.getConstraints( foeSignal, foeId) #针对轨道信号普通交叉口会报错5.getControlledLanes(self, tlsID) getControlledLanes(self, tlsID) getControlled Lanesself tlsID getControlledLanes(string) - c Returns the list of lanes which are controlled by the named traffic light. 返回由命名红绿灯控制的车道列表traci.trafficlight.getControlledLanes(tlsID0) #(4i_0, 2i_0, 3i_0, 1i_0)返回车道列表id6.getControlledLinks(self, tlsID) getControlled Linksself tlsID getControlledLinks(string) - list(list(list(string))) Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane. 返回由红绿灯控制的链接按信号索引排序并通过给出传入、传出和通过通道。traci.trafficlight.getControlledLinks(tlsID0) #[[(4i_0, 3o_0, :0_0_0)], #[(2i_0, 1o_0, :0_1_0)], #[(3i_0, 4o_0, :0_2_0)], #[(1i_0, 2o_0, :0_3_0)]] #返回车道id,这里的车道指的是经过交叉口的所有车道包括进口道出口道的路径7.getNemaPhaseCalls(self, tlsID) getNemaPhaseCallsself tlsID getNemaPhaseCalls(string) - list(string) Get the vehicle calls for the phases.The output is vehicle calls (coming from the detectors) for the phases. 获取车辆对相位的调用。输出为车辆对相位来自检测器的调用。注意需要是Nema类型的信号灯才可以调用其它类型调用会报错 8.getNextSwitch(self, tlsID) getNextSwitchself tlsID getNextSwitch(string) - double Return the absolute simulation time at which the traffic light is schedule to switch to the next phase (in seconds). 返回红绿灯计划切换到下一阶段的绝对模拟时间以秒为单位traci.trafficlight.getNextSwitch(0) #31.09.getPhase(self, tlsID) 、getPhaseDuration(self, tlsID)、getPhaseName(self, tlsID) 这三个方法的用法类似放在一起讲 getPhaseself tlsID获取当前相位信息 getPhase(string) - integer Returns the index of the current phase within the list of all phases of the current program. 返回红绿灯计划切换到下一阶段的绝对模拟时间以秒为单位。返回当前程序所有阶段列表中当前阶段的索引。traci.trafficlight.getPhase(0) # 返回值为 2getPhaseDuration(string) - doubleReturns the total duration of the current phase (in seconds). This value is not affected by the elapsed or remaining duration of the current phase. 返回当前相位的总共时长不受剩余相位时间影响相当于返回某个信号周期的某个相位的完整时长traci.trafficlight.getPhaseDuration(0) #返回值为31.0getPhaseNameself tlsID getPhaseName(string) - string Returns the name of the current phase. 返回相位名称自定义如果没有定义返回为空字符串traci.trafficlight.getPhaseName(0)仿真示例代码链接如下 链接https://pan.baidu.com/s/1IFs4UJUBPxPM_LUTSrcmSw **提取码**Sumo 欢迎交流
http://www.w-s-a.com/news/577178/

相关文章:

  • asp.net空网站php网站开发要学什么
  • 做可视化的网站微信网站模版下载
  • 包头移动的网站建设茂名建站价格
  • 网站文章内容一键排版功能铜山网站建设
  • cdr可不可做网站对网站建设起到计划和指导的作用
  • 合肥最好的网站建设网页设计心得体会2000字
  • 西安网站品牌建设门户网站类型
  • 网上做调查问卷的网站请人做网站域名和主机
  • 个人网站模板html5找公司网站建设
  • 找最新游戏做视频网站一个做网站的团队需要哪些人员
  • 威海市做网站的做网站很难吗
  • 广州房地产网站建设方案怎么免费申请网站
  • 免费生成网站软件下载影视公司名字取名
  • 网站公司提供程序免费的网页入口
  • jsp网站开发实例教学房产网站怎么做400电话
  • 网络营销方式及流程广州seo工作
  • 专业商城网站制作免费网页设计成品
  • 韩国优秀设计网站找做网站找那个平台做
  • 贵州省清镇市建设学校网站国家企业信用信息公示系统官网河北
  • 游戏界面设计网站网站建设问一问公司
  • 织梦网站模板如何安装教程视频国外哪些网站可以注册域名
  • 用群晖做网站网站中文名称注册
  • 做一个企业网站需要哪些技术app开发公司名字
  • 网站建设有技术的公司图片在线设计平台
  • 建公司网站的详细步骤关于进一步加强网站建设
  • 丰宁县有做网站的吗?维护一个网站一年多少钱
  • 杭州网站设计渠道wordpress购物主题
  • 山东政务网站建设文字logo免费设计在线生成
  • 韩雪个人网站唐山网络运营推广
  • 查建设工程业绩在哪个网站网站建设优化服务如何