问题描述
我正在尝试评估使用OMNeT ++,Venins和SUMO在车辆网络上运行的应用程序.由于该应用程序依赖于现实的交通行为,因此我决定使用 LuST场景,这似乎是此类数据的最新状态.但是,我想使用此方案的特定部分而不是整个方案(例如,高流量负载片段和低流量负载片段,也许还有其他片段).保持VEINS提供的双向功能会很好,尽管我最感兴趣的是将交通数据从SUMO导入到我的仿真中.
I'm trying to evaluate an application that runs on a vehicular network using OMNeT++, Veins and SUMO. Because the application relies on realistic traffic behavior, so I decided to use the LuST Scenario, which seems to be the state of the art for such data. However, I'd like to use specific parts of this scenario instead of the entire scenario (e.g., a high and a low traffic load fragment, perhaps others). It'd be nice to keep the bidirectional functionality that VEINS offers, although I'm mostly interested in getting traffic data from SUMO into my simulation.
实现此目的的一种显而易见的方法是使用预热期.但是,我想知道是否有一种更有效的方法-仅模拟8小时的流量以获得几分钟的片段感觉效率低下,并且对于具有足够重复次数的模拟来说可能会成问题.
One obvious way to implement this would be to use a warm-up period. However, I'm wondering if there is a more efficient way -- simulating 8 hours of traffic just to get a several-minute fragment feels inefficient and may be problematic for simulations with sufficient repetitions.
VEINS是否具有用于预热阶段的内置机制,主要是一种避免发送消息的机制(这是模拟中最耗时的部分),或者它有一种等待SUMO前进的方式例如特定的时间戳(这也避免了在OMNeT ++中创建车辆对象,从而避免了所有初始化代码)?
Does VEINS have a built-in mechanism for warm-up periods, primarily one that avoids sending messages (which is by far the most time consuming part in the simulation), or does it have a way to wait for SUMO to advance, e.g., to a specific time stamp (which also avoids creating vehicle objects in OMNeT++ and thus all the initiation code)?
在相关的情况下-我使用的是OMNeT ++和SUMO的最新稳定版本(带有SUMO 0.25.0的OMNeT ++ 4.6),并且我的代码库基于VEINS 4a2(进行了一些更改,尤其是接受了TraCI API版本) 10).
In case it's relevant -- I'm using the latest stable versions of OMNeT++ and SUMO (OMNeT++ 4.6 with SUMO 0.25.0) and my code base is based on VEINS 4a2 (with some changes, notably accepting the TraCI API version 10).
推荐答案
您可以在此处执行以下两项操作,以减少静脉中已发送消息的数量:
There are two things you can do here for reducing the number of sent messages in Veins:
-
按照此处在手册中.基本上,这意味着在
.ini
文件中设置warmup-period
,并确保您的代码使用if (simTime() >= simulation.getWarmupPeriod())
进行了检查.用于结果收集的OMNeT ++信号已意识到这一点.
Use the OMNeT++ Warm-Up Period as described here in the manual. Basically it means to set
warmup-period
in your.ini
file and make sure your code checks this withif (simTime() >= simulation.getWarmupPeriod())
. The OMNeT++ signals for result collection are aware of this.
TraCIScenarioManager
提供了变量double firstStepAt @unit("s")
,您可以使用该变量延迟其启动.同样,可以在.ini
文件中进行设置.
The TraCIScenarioManager
offers a variable double firstStepAt @unit("s")
which you can use to delay the start of it. Again this can be set in the .ini
file.
正如 VEINS常见问题解答所述,TraCIScenarioManagerLaunchd
提供了两个变量根据矩形或道路(string roiRoads
和string roiRects
)配置关注区域.要减小模拟区域,可以将模拟限制为特定的矩形;例如,矩形".例如,*.manager.rioRects="1000,1000-3000,3000"
模拟两个提供的坐标之间的2x2km区域.
As the VEINS FAQ states, the TraCIScenarioManagerLaunchd
offers two variables to configure the region of interest, based on rectangles or roads (string roiRoads
and string roiRects
). To reduce the simulated area, you can restrict simulation to a specific rectangle; for example, *.manager.rioRects="1000,1000-3000,3000"
simulates a 2x2km area between the two supplied coordinates.
使用这两种解决方案(最好结合使用),您仍然必须运行SUMO-但是Veins几乎没有时间消耗.
With both solutions (best used in combination) you still have to run SUMO - but Veins barely consums any of the time.
这篇关于使用SUMO场景的子集进行OMNeT ++网络仿真(使用VEINS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!