//Get the module type, as the goal is to create more of the same
cModuleType *moduleType = this->getParentModule()->getModuleType();
//Create the module and initialize its parameters (the mobility type is the only parameter)
cModule *module = moduleType->create("rsu", this->getParentModule()->getParentModule(), numModules, curModule);
module->par("mobilityType") = "MySimpleMobility";
module->finalizeParameters();
module->buildInside();
//Get the submodule of the created module and set the parameters (the x/y/z coordinates in this case)
module->getSubmodule("mobility")->par("x") = initX;
module->getSubmodule("mobility")->par("y") = initY;
module->getSubmodule("mobility")->par("z") = initZ;
//Schedule the start of the created module
module->scheduleStart(simTime());
//Added this in because it made things work…? Otherwise I received an error stating the submodule (mobility) was not initialized
module->callInitialize();
I used to read omnet++ manual to generate the RSUs dynamically. I’ve created
rsu.ned from Car.ned file with a LinearMobility instead of tracimobility used
in car.ned
The probleme I encountred is that I don’t know where to inject the c++ code to generate dynamically this RSUs. I created a new c++ file rsu.cc but no RSU was generated.
Can you please give me some clarification about where to inject the C++ code to generate the RSUs.
TALBI Elhadi