In a "n" submodules network, how can a message start in a random position?

17 views
Skip to first unread message

Pedro BAGATIN VELEDA BERMUDEZ

unread,
Jan 19, 2017, 2:23:17 AM1/19/17
to OMNeT++ Users
In a network with 3 submodules I don't want that a message starts always in the submodule[0] for example.
So I was thinking to change in the network declaration, as it follows:

simple Txc1
{
   parameters:
      bool sendMsgOnInit = default(false);
   gates:
      inout gate[ ];
}

network three_nodes
{
   types:
      channel Channel extends ned.DelayChannel   {
             delay = 100ms;
      }
   submodules:
      tic[3]: Txc1{
           parameters: tic[2].sendMsgOnInit = true;
      }
    connections:
       tic[0].gate++ <--> Channel <--> tic[1].gate++;
       tic[0].gate++ <--> Channel <--> tic[2].gate++;
       tic[1].gate++ <--> Channel <--> tic[2].gate++;
}

How can I declare it properly? After that I am planning to change the index (in this case 2) to a random value.

Rudolf Hornig

unread,
Jan 19, 2017, 4:45:29 AM1/19/17
to OMNeT++ Users
Specify that in the INI file and not in the NED file. Just add

*.tic[2].sendMsgOnInit = true

in the INI file.
Reply all
Reply to author
Forward
0 new messages