We have a network topology. There is a base station, 36 LCN and 1500 sensor nodes.Base station makes request in every 5 min from randomly selected lcn (Target lcn) and it selects the random sense value.While simulating, If every lcn is visited I want to delete 2 of lcn randomly in every round. I used the code below but I cannot reach the other lcns to delete it.I can only reach the target lcn. I can get the every sensors coordinates by the way.
cModuleType *moduleType = cModuleType::get("lcn");
cModule *module = moduleType->create("node", this);
random=intuniform(0,36);
module->setID(random);
deleteModule();
However, I cannot set the Id to delete.It deletes the current module.I need some help