SUMO/检测器设置(E3)学习总结

2023-05-16

一、E3检测器简介

       Multi-Entry-Exit Detectors(E3)可以用来检测通过检测区域的平均速度、车辆通过检测区域的平均停车次数、车辆通过区域的平均延误、一段时间内进入检测区域车辆数、一段时间内进入检测区域但还未离开的所有车辆的平均速度、一段时间内进入检测区域但还未离开的所有车辆的平均停车次数等,详见下表。

NameTypeDescription
begin(simulation) secondsThe first time step the values were collected in
end(simulation) secondsThe last time step + DELTA_T the values were collected in (may be equal to begin)
ididThe id of the detector
meanTravelTimesThe time vehicles needed to pass the area (the crossing of the vehicle front counts). Averaged over all vehicles which left the detector completely during the interval duration.
meanOverlapTravelTimesThe time vehicles needed to pass the area (any time a part of the vehicle was in the detection range counts). Averaged over all vehicles that have left the detector completely during the interval duration.
meanSpeedm/sThe mean speed of vehicles that have passed the area. Averaged over the interval and vehicles.
meanHaltsPerVehicle#The number of halts of vehicles that have passed the area. Averaged over all vehicles that have left the detector during the interval duration.
meanTimeLosssThe average time loss for all vehicles that have passed the area.
vehicleSum#The number of vehicles that have left the area during the interval.
meanSpeedWithinm/sThe mean speed of those vehicles that have entered, but not yet left the area. Averaged over the time each vehicle was in the area and vehicles.
meanHaltsPerVehicleWithinm/sThe mean number of haltings of those vehicles that have entered, but not yet left the area. Averaged over the time each vehicle was in the area and vehicles.
meanDurationWithinsThe mean duration is within the area of those vehicles that have entered, but not yet left the area. Averaged over the time each vehicle was in the area and vehicles.
vehicleSumWithinsThe number of vehicles that have entered but not yet left the area.
meanIntervalSpeedWithinm/sThe mean speed of those vehicles that have entered, but not yet left the area, collected during the written interval. Averaged over the interval and vehicles.
meanIntervalHaltsPerVehicleWithin#The number of vehicles that have left the area during the interval, collected during the written interval. Averaged over the interval and vehicles.
meanIntervalDurationWithinsThe number of vehicles that have left the area during the interval, collected during the written interval. Averaged over the interval and vehicles.
meanTimeLossWithinsThe average time loss collected by vehicles that have entered but not yet left the area during the written interval.

二、设置检测器

1. 创建 .add 文件

在文件夹中创建一个文本文件,将后缀改为“.add”。 

2.写文件

用pycharm打开文件,将官网中关于定义的代码模板复制进去。

<additional>
   <entryExitDetector id="<ID>" freq="<AGGREGATION_TIME>" file="<OUTPUT_XMLFILE>" 
   timeThreshold="<FLOAT>" speedThreshold="<FLOAT>">
      <detEntry lane="<LANE_ID1>" pos="<POSITION_ON_LANE>" friendlyPos="<BOOL>"/>
      <detEntry lane="<LANE_ID2>" pos="<POSITION_ON_LANE>" friendlyPos="<BOOL>"/>
      <detExit lane="<LANE_ID1>" pos="<POSITION_ON_LANE>" friendlyPos="<BOOL>"/>
      <detExit lane="<LANE_ID3>" pos="<POSITION_ON_LANE>" friendlyPos="<BOOL>"/>

      ... further entries ...

   </entryExitDetector>
</additional>

根据自己的实际需要修改其中的参数。

输入参数包括:

  • ID编号;
  • freq检测频率,经过多长时间要汇总一次检测数据,单位为秒;
  • file输出文件的路径,文档名称,可以是.xml文件;
  • timeThreshold,一个时间阈值,过多长时间车辆可以被认为是停车(问题:这个时间是指车辆在某个地方停留不动的时间吗),默认为1s;
  • speedThreshold,基于速度的阈值,用于描述车辆必须以多慢的速度被识别为停车,默认为5/3.6m/s;
  • openEntry,一个逻辑变量,为真时表示若发生检测到车辆从检测区域出去却没有检测到其进入检测区域的情况时,不报错;
  • vTypes,类型为string,需要检测的车辆类型;
  • detectPersons,类型为string,表示需要检测的是行人或乘客而不是机动车。

之后,设置检测器的位置。输入在哪条车道,即车道ID、什么位置设置检测器。一个Entry和它对应的Exit组成一个检测器。

<additional>
   <entryExitDetector id="ETW1" freq="30" file="output_E3.xml"
   timeThreshold="1" speedThreshold="3.6">
      <detEntry lane="-E1_0" pos="40" friendlyPos="<BOOL>"/> #东进口右转
      <detEntry lane="-E1_1" pos="40" friendlyPos="<BOOL>"/> #东进口第1直行车道
      <detEntry lane="-E1_2" pos="40" friendlyPos="<BOOL>"/> #东进口第2直行车道
      <detEntry lane="-E1_3" pos="40" friendlyPos="<BOOL>"/> #东进口第3直行车道
      <detEntry lane="-E1_4" pos="40" friendlyPos="<BOOL>"/> #东进口第1左转车道
      <detExit lane="E3_0" pos="40" friendlyPos="<BOOL>"/> #东进口右转
      <detExit lane="E0_0" pos="40" friendlyPos="<BOOL>"/> #东进口第1直行车道
      <detExit lane="E0_1" pos="40" friendlyPos="<BOOL>"/> #东进口第2直行车道
      <detExit lane="E0_2" pos="40" friendlyPos="<BOOL>"/> #东进口第3直行车道
      <detExit lane="E2_2" pos="40" friendlyPos="<BOOL>"/> #东进口第1左转车道

      ... further entries ...

   </entryExitDetector>
</additional>

 三、进行仿真与检测

1.创建configuration文件

通过在netedit里画交叉口,得到了.net文件,也已经写好了.rou文件,还有上一步刚写好的用于布置检测器.add文件以及用于输出检测结果的.xml文件,接下来要通过configuration文件使他们能够运行。configuration文件的代码格式如下:

<configuration>
    <input>
        <net-file value="hello.net.xml"/>
        <route-files value="hello.rou.xml"/>
    </input>
    <time>
        <begin value="0"/>
        <end value="10000"/>
    </time>
</configuration>

除了net-file/route-file,configuration文件还可以输入这些:(详见链接:https://sumo.dlr.de/userdoc/sumo.html)

关于设置检测器时需要编写的.add文件的介绍:https://sumo.dlr.de/docs/sumo.html#format_of_additional_files

OptionDescription
-n <FILE>
--net-file <FILE>
Load road network description from FILE
-r <FILE>
--route-files <FILE>
Load routes descriptions from FILE(s)
-a <FILE>
--additional-files <FILE>
Load further descriptions from FILE(s)
-w <FILE>
--weight-files <FILE>
Load edge/lane weights for online rerouting from FILE
-x <STRING>
--weight-attribute <STRING>
Name of the xml attribute which gives the edge weight; default: traveltime
--load-state <FILE>Loads a network state from FILE
--load-state.offset <TIME>Shifts all times loaded from a saved state by the given offset; default: 0
--load-state.remove-vehiclesRemoves vehicles with the given IDs from the loaded state
--junction-taz <BOOL>Initialize a TAZ for every junction to use attributes toJunction and fromJunction; default: false

创建一个文本文件,把后缀改为“.sumocfg"。用pycharm打开进行编辑。

<configuration>
    <input>
        <net-file value="intersection_ply.net.xml"/>
        <route-files value="intersection_ply.rou.xml"/>
        <additional-files value="intersection_ply.add.xml"/>
    </input>

    <time>
        <begin value="0"/>
        <end value="7200"/>
    </time>
</configuration>

2.进行仿真

用sumo-gui打开上一步的配置文件。

出现了错误,表示路网文件打不开,在文件夹看了一下,发现是路网文件的名字打错了,导致configuration文件中的路网文件名与实际的路网文件名不一致。

修改后又出现了新的错误,显示add文件加载失败:Loading of additional-files failed.

 为了确定其他文件有没有问题,先在configuration文件中把与add文件相关的代码删掉,看看如果不加检测器的话是否能正常运行。

<configuration>
    <input>
        <net-file value="intersection_ply.net.xml"/>
        <route-files value="intersection_ply.rou.xml"/>


    </input>

    <time>
        <begin value="0"/>
        <end value="7200"/>
    </time>
</configuration>

用sumo-gui打开,仍然报错:Invalid departLane definition for flow 'd11'

说明rou文件写错了。经过一番查找之后,发现“departLane"设置错了,不能输入车道的编号,需输入对应的index。

 #东进口第1左转车道
    <flow id="d11" color="1,1,0"  begin="0" end= "7200" vehsPerHour='180' type="CarA" departLane="-E1_4" departSpeed="max">
     <route edges="-E1 E2"/>
    </flow>

 

 把上面的“departLane"参数改成如下形式(其他flow也进行修改),成功运行:

 #东进口第1直行车道
    <flow id="d12" color="1,1,0"  begin="0" end= "7200" vehsPerHour='296' type="CarA" departLane="1" departSpeed="max">
     <route edges="-E1 E0"/>
    </flow>

接下来把add文件重新加入到configuration文件中,看能否运行。还是显示Loading of additional-files failed.拖动报错栏,发现它提示了我哪里出错了——friendlyPos="<BOOL>"没有设置。(这个错误实在是...)

<detEntry lane="-E1_0" pos="40" friendlyPos="<BOOL>"/> #东进口右转

通过搜索发现friendlyPos表示当设置的pos超出lane的范围是,自动设置位置为lane的起点或者终点,因此将其设置为1,改后代码如下,成功运行。

<additional>
   <entryExitDetector id="ETW1" freq="30" file="output_E3.xml"
   timeThreshold="1" speedThreshold="3.6">
      <detEntry lane="-E1_0" pos="40" friendlyPos="1"/> #东进口右转
      <detEntry lane="-E1_1" pos="40" friendlyPos="1"/> #东进口第1直行车道
      <detEntry lane="-E1_2" pos="40" friendlyPos="1"/> #东进口第2直行车道
      <detEntry lane="-E1_3" pos="40" friendlyPos="1"/> #东进口第3直行车道
      <detEntry lane="-E1_4" pos="40" friendlyPos="1"/> #东进口第1左转车道
      <detExit lane="E3_0" pos="40" friendlyPos="1"/> #东进口右转
      <detExit lane="E0_0" pos="40" friendlyPos="1"/> #东进口第1直行车道
      <detExit lane="E0_1" pos="40" friendlyPos="1"/> #东进口第2直行车道
      <detExit lane="E0_2" pos="40" friendlyPos="1"/> #东进口第3直行车道
      <detExit lane="E2_2" pos="40" friendlyPos="1"/> #东进口第1左转车道

      ... further entries ...

   </entryExitDetector>
</additional>

图中红色线和蓝色线表示的就是检测器(只设置了东进口的车流和检测器用于测试)。

 3.输出数据分析

首先来看官网给出的检测数据示例:

用pycharm打开之前创建的输出文件(.xml), 发现里面信息的格式是:每一行为每一秒检测到的各种输出数据,到30s时(之前设定的freq)就输出一行下面这样的信息。有时meanTravelTime、meanOverlapTravelTime的值为-1,猜测可能是因为这个间隔内由于红绿灯或其他原因而没有车辆通过检测区域。各项数据的含义可以参见官网。

<interval begin="240.00" end="270.00" id="ETW1" meanTravelTime="32.52" meanOverlapTravelTime="32.94" meanSpeed="9.07" meanHaltsPerVehicle="0.21" meanTimeLoss="25.45" vehicleSum="29" meanSpeedWithin="9.66" meanHaltsPerVehicleWithin="0.20" meanDurationWithin="23.99" vehicleSumWithin="10" meanIntervalSpeedWithin="9.64" meanIntervalHaltsPerVehicleWithin="0.00" meanIntervalDurationWithin="10.64" meanTimeLossWithin="6.34"/>

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

SUMO/检测器设置(E3)学习总结 的相关文章

  • 设置VirtualBox共享文件夹的方法

    文章难度 xff1a 入门 环境 xff1a 软件环境 xff1a VirtualBox xff1a 5 2 34 主机操作系统 xff1a Windows 7专业版 虚拟机操作系统 xff1a Ubuntu 16 04 Desktop a
  • VirtualBox加载光盘的镜像文件

    环境 xff1a 软件环境 xff1a 操作系统 xff1a Windows 7专业版 VirtualBox xff1a 5 2 34 硬件环境 xff1a CPU xff1a Intel i5 内存 xff1a 8G 大部分新建的Virt
  • git设置http全局代理

    git config global 变量名称 变量内容 git config global unset 取消变量 例如 xff1a git设置全局http代理和https代理 git config global http proxy 127
  • ubuntu 20.04 gedit中文乱码的解决方法

    Ubuntu 20 04的gedit打开中文时会出现乱码 不废话 xff0c 直接上代码 打开命令行后 xff0c 输入如下指令 xff1a gsettings span class token keyword set span org g
  • Emacs中插入当前光标处的单词

    在查找时 xff0c 如果我们希望直接查找当前光标处的单词 xff0c 我们可以这样做 将光标移动到单词的第一个字母 使用快捷键 xff1a M 43 j 在Windows上M是ALT按键 如果觉得有帮助 xff0c 请点赞收藏 xff0c
  • 解决gitlab-ee安装时碰到的错误 28:in `initialize‘: undefined method `[]‘ for nil:NilClass (NoMethodError)

    直接开始解决问题 安装postgresql sudo apt install postgresql 重新配置gitlab sudo gitlab ctl reconfigure 继续安装gitlab sudo apt install gil
  • 【重识云原生】第四章云网络4.8.4节——OpenStack与SDN的集成

    1 Neutron项目简介 1 1 项目简介 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp OpenStack自己官方的网络项目是Neutron Neutron有着自己的一套网络实现方案 基于linux n
  • 【重识云原生】第六章容器6.3.1节——K8S核心组件总述

    1 K8S核心组件分类 一个kubernetes集群主要是由控制节点 master 工作节点 node 构成 xff0c 每个节点上都会安装不同的组件 xff0c 依然先放上经典的K8S架构图 xff1a 1 1 Master Master
  • xmanager远程Ubuntu1604LTS

    xmanager远程Ubuntu1604LTS 方案综述与选择 私有云走入千家万户 xff0c 单位要搞虚拟机 xff0c 终端要远程方式登陆 windows的mstsc xff0c centos6 3的xdmcp与xmanager都很好用
  • MySQL数据库 - 单表查询(三)

    第1关 对查询结果进行排序 本关任务 以成绩的降序显示学生成绩表中所有信息 USE School span class token punctuation span 请在此处添加实现代码 Begin 查询 span class token
  • BGP LinkState

    BGP LinkState xff1a 描述链路状态的路由协议 xff0c 一共由3部分组成 xff0c Node 43 Link 43 Prefix 通过查看prefic的detail信息查看sid xff0c 每个prefix都有一个s
  • 华为鲲鹏云服务器编译安装mysql-5.7.27 报错error: could not split insn

    华为鲲鹏云底层跟原来的华为云服务器又点区别 1 编译安装mysql 5 7 27时 xff0c 走到一半出现error could not split insn 无法在进行下一步 首先查看一下自己的gcc的版本 rpm qa grep gc
  • 3种云桌面(VDI、IDV、VOI)技术解决方案简介

    概述 云桌面技术的出现以其具有灵活性 安全性大大地简化了运维人员对终端设备的运维工作 同时也让用户可以不再局限于设备 地点 时间 xff0c 随时随地都可以通过网络访问自己的桌面系统了 云桌面技术作为云计算虚拟化技术的一种方式 xff0c
  • [H3C] 5120V2设备配置WEB以及TELNET界面

    H3C 5120V2设备配置WEB以及TELNET界面 Int vlan 1 Ip add 192 168 15 132 25 添加IP地址 H3C local user admin 建立一个新用户 New local user added
  • BFD的原理及配置

    BFD 简述 BFD xff08 Bidirectional Forwarding Detection xff0c 双向转发检测 xff09 是一个通用的 标准化的 介质无关和协议无关的快速故障检测机制 xff0c 用于检测IP网络中链路的
  • ISIS协议基础知识

    前言 介绍 ISIS xff0c 中间系统到中间系统的网络协议 xff0c 最初是OSI组织为了他的CLNP xff08 类似于TCP IP中的IP网络 xff09 而设计的动态路由协议 xff0c 后IETF对其进行修改和填充 xff0c
  • 信息安全管理与评估 21年国赛真题解析答案

    祝各位选手在比赛中荣获佳绩 xff0c 网络系统管理与信息安全交流群可见其他文章 xff0c 欢迎各位的加入 本文仅供参考 xff0c 请勿购买专栏 xff0c 有意合作私聊 DCRS工作任务 DCRS 开启 telnet 登录功能 xff
  • 神州数码 AP上线指南(待优化)

    网络安全 amp 网络系统管理交流群 xff1a 320870333 AP默认地址192 168 1 10 wireless no auto ip assign enable ap authentication none discovery
  • 【IPv6】IPv6 NDP邻居状态详解

    NDP 邻居状态 任意两个通信的主机在通信之前 xff0c 先要建立邻居 xff08 省的去查找arp了 xff09 因为接下来的文字会很乱 xff0c 排版费劲 xff0c 所以用这个来 未完成 Incomplete 可达 Reachab
  • 【IPv6】基本概念及字段

    IPV4知识点 xff1a 字段值 IPv4字段共 字段值解释Version版本版本字段 xff0c 可以区分V4和V6版本 xff0c V4是0100 xff0c V6是0110 xff0c 需要注意的是V4和V6头部除了版本字段位置相同

随机推荐

  • 【IPv6】基本概念及字段

    IPV4知识点 xff1a 字段值 IPv4字段共 字段值解释Version版本版本字段 xff0c 可以区分V4和V6版本 xff0c V4是0100 xff0c V6是0110 xff0c 需要注意的是V4和V6头部除了版本字段位置相同
  • 智能云卸载残留问题

    在今天我将1803版本更新到了1809版本 xff0c 更新之后我就发现输入法多了一个 智能云输入法 看来是之前对于卸载智能云输入法并没有卸载的很全面 彻底删除两部曲 卸载智能云就不需要教了把 一 先将智能云输入法从语言选项中删除 步骤 x
  • Ubuntu 20.04下安装微信

    Ubuntu 20 04下安装wine微信 安装必要的工具及deepin wine依赖 sudo apt install wget g 43 43 git 安装deepin wine git clone https gitee com ws
  • Unable to determine the device handle for GPU 0000:04:00.0: GPU is lost. Reboot the system to recov

    Original url https askubuntu com questions 235760 unity does not appear after installing proprietary nvidia drivers gpu
  • 【Maven】Maven报错:The packaging for this project did not assign a file to the build artifact

    Maven Maven报错 xff1a The packaging for this project did not assign a file to the build artifact 问题描述问题发生问题解决 问题描述 对写好的项目打
  • ubuntu系统安装clamav

    ubuntu系统安装clamav 添加用户 groupadd clamav useradd g clamav s bin false c 34 Clam AntiVirus 34 clamav 安装 sudo apt get install
  • SQLyog无法连接Linux下的MySQL问题

    SQLyog直接连接报错 xff1a 解决步骤 xff1a 一 测试网络 windows cmd上ping linux ip地址查看是否能ping通 二 关闭MySQL防火墙 systemctl stop firewalld xff08 开
  • 正则表达式边界符中的 ^, $, \A, \Z, \z

    转载自 http blog csdn net ggicci article details 8015087 Regex 本文介绍正则表达式中边界符 和 以及 A 和 Z z 的比较和用法 本文的正则表达式在 Java 中测试 本文的一些概念
  • vnc的默认端口更改

    vnc的默认端口是5901 xff0c 这个说法是不对的 vnc并不是只有一个端口 以前另一个文章介绍了nvcserver的配置用户的过程 xff0c 里面提到了桌面号 xff0c 这个桌面号就可以端口有密切关系 先看看这个配置 VNCSE
  • CentOS查看开启端口

    安装nmap yum span class hljs keyword install span nmap span class hljs comment 输入y安装 span 使用nmap span class hljs title nma
  • 使用stm32互补输出PWM波并且控制死区时间,带刹车功能

    使用stm32互补输出PWM波并且控制死区时间 xff0c 带刹车功能 项目背景 xff1a 需要20k带死区时间的互补pwm波连接IGBT驱动器 使用高级定时器1 xff0c CH1 PA8 CH1N PB13 BKIN PB12 如果是
  • tensorflow2安装教程

    本教程还未写完请不要看 参考网站 官网 https tensorflow google cn tutorials keras classification hl 61 zh cn 分析视频 https www bilibili com vi
  • 创建支持es6,vscode可调试的nodejs es6工程

    通常vscode调试es6工程时 xff0c 比如有import语句 xff0c 会有如下错误 xff1a SyntaxError Unexpected token import 网上有很多例子都是不可行的 xff0c 或者是老版本的vsc
  • Docker 镜像使用帮助

    注意 本镜像只提供 Debian Ubuntu Fedora CentOS RHEL 的 docker 软件包 xff0c 非 dockerhub Docker 官方在 2015 年 7 月启用新的仓库 xff0c 软件包名由 lxc do
  • Linux下安装VNC图形化远程桌面工具

    Linux 下安装 xff1a 1 下载 vncserver vncview vnc Linux 版 下载地址 http download csdn net detail jxmykl 7789529 vnc Windows 版 下载地址
  • 对抗攻击Adversarial Attack

    参考链接 xff1a xff08 1 xff09 对抗攻击常见方法汇总 https blog csdn net qq 43367558 article details 121694626 xff08 2 xff09 对抗性样本攻击方法汇总
  • docker 防火墙 设置不生效问题解决

    centos7 想把容器的端口8500禁止掉 方法1 firewall cmd zone 61 public remove port 61 8500 tcp permanent xff08 没有用 xff09 报错Warning NOT E
  • 【组成原理期末复习】06总线系统

    一 基本概念 定义 数字计算机是由若干系统功能部件构成的 xff0c 这些系统功能部件在一起工作才能形成一个完整的计算机系统 计算机的若干功能部件之间不可能采用全互联形式 需要有公共的信息通道 xff0c 即总线 总线是构成计算机系统的互联
  • Build ONIE SDK

    Linux ubuntu 4 15 0 29 generic 31 16 04 1 Ubuntu SMP Wed Jul 18 08 54 04 UTC 2018 x86 64 x86 64 x86 64 GNU Linux sudo ap
  • SUMO/检测器设置(E3)学习总结

    一 E3检测器简介 Multi Entry Exit Detectors xff08 E3 xff09 可以用来检测通过检测区域的平均速度 车辆通过检测区域的平均停车次数 车辆通过区域的平均延误 一段时间内进入检测区域车辆数 一段时间内进入