1

I have 2 types of submodules in my network.

  1. AdhocHost which is standard definition in INET framework.
  2. module of type IMobility with its mobility type of type RandomWPMobility, both are standard INET modules.

I can get the location of modules of type AdhocHost by this code:

module = simulation.getModuleByPath("Mynet.host[1]");
c = MobilityAccess().get(module)->getCurrentPosition();

host[*] being of type AdhocHost.

But when I replace host[1] with blockage[1] (blockage is of type IMobility), before running simulation this error appears:

Error in module (MyMobileController) Mynet.mymobilecontroller during network initialization: Model error: module (IMobility)mobility not found.

The module mymobilecontroller is the module that contains this fraction of code. This module does not need to move. Its duty is just to record the location of mobile modules in the network.

What is the problem?

user4786271
  • 1,555
  • 13
  • 18
Masoud
  • 305
  • 1
  • 12
  • please accept the answer that solved you problem, for future users. Also edit your question to add the code modifications you did to solve the problem. – user4786271 Jul 10 '15 at 11:15

1 Answers1

2

The 'MobilityAccess' code expects that you pass a NetworkNode to it that contains a submodule named mobility with the type IMobility. In the first case it is true (with a StandardHost) however in the second case you pass directly an module that has a type of IMobility.

Long story short, a module with a type of IMobility is meant to exist INSIDE of a network node and not at the network level.

Solution: I'm not sure what is the blockage module supposed to do, but it should NOT be a type of IMobility, instead it should be a module that contains a submodule with a type IMobility.

Rudi
  • 6,418
  • 1
  • 16
  • 20