omnet++

How do I call a parameter for a compound module?

我怕爱的太早我们不能终老 提交于 2019-12-08 12:16:09
问题 I am using omnet++, and was wondering how do I get a parameter in a c++ file of a compound module. module server { parameters: int server; submodule: //Queue // processor } calling the par function in c++ is working for me. 回答1: Compound module doesn't have C++ code. Only simple modules have a C++ code. To get the value of a compound module's parameter from code of simple module one can use: getParentModule()->par("foo"); An example. NED file: module Server { parameters: int cpuNumber;

Why I get an error code 139 if I run this code?

一个人想着一个人 提交于 2019-12-08 11:17:01
问题 I would like to know why I can build this project, but as soon as RSU receives the message I get an error 139. Even if I try to solve by removing the code inserted in onData function and run the project again, still doesn't work. TraCIDemoRSU11p.h TraCIScenarioManager* manager; TraCICommandInterface* traci; TraCIDemoRSU11p.cc void TraCIDemoRSU11p::initialize(int stage) { BaseWaveApplLayer::initialize(stage); if (stage == 0) { manager = TraCIScenarioManagerAccess().get(); traci = manager-

How to edit the source code of Omnet++?

大城市里の小女人 提交于 2019-12-08 09:47:49
问题 When I run Omnet++, it loads .ini and .ned files, and performs a simulation and writes the results in .sca and .vec file. However I want to modify the source code such that while Omnet++ is running, it loads the input files like every 100 msec and also writes the results after that interval. How should we modify the code? Is there any other way to update .ini and .ned file while the simulation is in progress without changing the source code? 回答1: Both modifying a running simulation and

How to get count of cars in specific range

时光总嘲笑我的痴心妄想 提交于 2019-12-08 06:09:02
问题 In veins i'm trying to simulate a VANET scenario in which if road is blocked then after specific time the car broadcast a message including blocked roadId and count of vehicles around it's 100 meter. In TraCIDemo11p application when the car is stopped for longer than 10 seconds it changes the node color to red (to show an accident) and sends a message out to other cars containing the blocked road id, all this is done in handlePositionUpdate mehtod: findHost()->getDisplayString().updateWith("r

Pedestrian Simulation in veins (omnet++/sumo)

痴心易碎 提交于 2019-12-08 05:09:58
问题 I'm trying to run a pedestrian simulation from sumo in omnet++. To keep it easy (i am a beginner) I decided to use the Erlangen example provided with veins and extend it with a couple of pedestrians. I added the pedestrians in sumo and ran it. It works perfectly fine: You can see the pedestrians and cars in this picture Next I was trying to run the whole thing in omnet++. I also managed to do that but the pedestrians were not shown. Just the cars. I read these two topics: Communication

Sent acks are received by multiple nodes in Veins-4a2 using prepareWSM method

蓝咒 提交于 2019-12-08 05:01:00
问题 I use OMNeT++-4.6, sumo-0.22.0 and Veins-4a2. In my scenario, when an RSU receives a message from a node, it sends an ACK using the prepareWSM method: sendWSM(prepareWSM("ack", ackLengthBits, type_SCH, ackPriority, senderId , 2)) So, the RSU sends an ACK to senderID which is the sender node of the message. In my log file, I notice that there are some nodes - not only the original sender node - which receive this ACK. I need to know if prepareWSM method diffuse the ACK to all nodes encountered

Sending a message when a vehicle leaves the simulation

半世苍凉 提交于 2019-12-08 03:52:56
问题 I use OMNeT++-4.6, sumo-0.22.0 and Veins-4a2. 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. 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. The goal

How external interfaces work in OMNETPP/INET?

﹥>﹥吖頭↗ 提交于 2019-12-07 21:10:26
问题 I have been trying in the past few days to build and run a very simple network to no avail (most of the network I try to build is borrowed from extServer example). No matter my configuration in terms of IP addresses, routes etc. I cannot seem to make it work. I have seen many people struggling with it, but have not found any solutions posted anywhere. The readme file in the Emulation folder of INET is more confusing than helpful. Hence, I would like your help in making the following simple

Can I create omnet++ cc source file for INET module StandaredHost or any module

随声附和 提交于 2019-12-06 16:58:20
问题 I don't know how this question will sound like but I'm this is the best place to ask anything about science. I am trying to create a cc omnet++ source file for INET modues. Like we do in simple module, we simple inherit that class with cSimpleModule and then we give implementation of Initialize and handleMessage methods. I tried creating a cc source file and then inherit it by StandaredHost and declared the both methods initialize and handleMessge, but it is not working. I want to know the

Sent acks are received by multiple nodes in Veins-4a2 using prepareWSM method

≡放荡痞女 提交于 2019-12-06 16:29:29
I use OMNeT++-4.6, sumo-0.22.0 and Veins-4a2. In my scenario, when an RSU receives a message from a node, it sends an ACK using the prepareWSM method: sendWSM(prepareWSM("ack", ackLengthBits, type_SCH, ackPriority, senderId , 2)) So, the RSU sends an ACK to senderID which is the sender node of the message. In my log file, I notice that there are some nodes - not only the original sender node - which receive this ACK. I need to know if prepareWSM method diffuse the ACK to all nodes encountered or if what I did to send only the ACK to the sender node is correct? Although you can set the receiver