0

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

ekn
  • 47
  • 9
  • I suggest adding a new simple module (called for example LcnSupervisor). This module does not receive nor send any messages. And this module will observe activity in the network and delete regular LCN modules according to some rules. Could you precise what you mean " If every lcn is visited"? – Jerzy D. Jun 16 '16 at 08:12
  • @ Jerzy D. If base station requested data packet from all the LCN, I count round as 1.Then I want to delete this module – ekn Jun 17 '16 at 04:27
  • When exactly do you want to delete two LCNs: **just after sending** a data packet request by the base station or **after receiving answers** from all requested LCN? And what if an answer from a LCN will not come to a base station (for example because of propagation conditions). Moreover: do you want to delete two LCNs selected from all LCNs or from a set to which the base station sent a packet request? – Jerzy D. Jun 20 '16 at 13:30

0 Answers0