车辆离开模拟时发送消息 [英] Sending a message when a vehicle leaves the simulation

查看:65
本文介绍了车辆离开模拟时发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用OMNeT ++-4.6,sumo-0.22.0和Veins-4a2.

I use OMNeT++-4.6, sumo-0.22.0 and Veins-4a2.

在我的模拟中,每个节点都会创建一条消息,并将其存储在其缓冲区中,并且经过一段时间的延迟后,它将发送其所有消息.我做了两个计时器来指定创建和发送消息的延迟.因此,发送的消息可能被另一个节点或作为RSU的目的地接收.

In my simulation, each node creates a message, stores it in its buffer and after some delay it sends all its messages. I did two timers to specify the delay of created and sent messages. So, the message sent may be receive by an other node or by the destination which is the RSU.

当所有节点根据.rou.xml文件中的指示路径到达目的地时,我的仿真结束.每个节点都在特定时间离开仿真.

My simulation ends when all nodes reach their destination according to the indicating path in .rou.xml file. Every node leaves the simulation at a specific time.

我的场景的目标是,每个节点在离开模拟时都会发送所有已存储的消息,并且它们必须由目标接收(在我的情况下为RSU).

The goal of my scenario is that every node sends all stored messages when leaving the simulation and they must be received by the destination which are RSU in my case.

有人可以告诉我如何使用self-message()或其他解决方案吗?

Can somebody tell me how can I do this using self-message() or an other solution please?

推荐答案

开始研究 TraCI协议文档,以了解是否以及如何在以下情况下获得通知车辆在其路线的尽头或找出车辆将在那儿的时间,因此您可以在此时安排自我信息.收到此通知后,您可以发送所有存储的消息,然后继续进行模拟,这将删除相应的节点.

Start looking into TraciScenarioManager and TraciCommandInterface to figure out how the communication with SuMO is done. Then check the TraCI protocol documentation to find out whether and how it is possibility to get notified when a vehicle is at the end of its route or to find out the time when the vehicle will be there so you can schedule a self message at this time. When you get this notification, you can send all messages you stored and then let the simulation continue which should remove the corresponding node.

我不认为现在有一种方法可以支持这种通知,但是当您知道协议的必要部分时,应该很直接地将此功能添加到模块中.

I don't think there is a method which supports such a notification right now but when you know the necessary parts of the protocol it should be rather straight forward to add this functionality to the modules.

这篇关于车辆离开模拟时发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆