Reputation: 121
I have two networks. For example I use tutorial Tictok1
and Tictok2
In one .ned
file. How can I run It in one simulation? I tried find solution in google for last two days.
I was tried config like:
[General]
network = Tictoc1,Tictoc2
or
[General]
network = Tictoc1;Tictoc2
The tictoc1.ned file:
simple Txc1
{
gates:
input in;
output out;
}
simple Txc2
{
parameters:
@display("i=block/routing"); // add a default icon
gates:
input in;
output out;
}
network Tictoc1
{
submodules:
tic: Txc1;
toc: Txc1;
connections:
tic.out --> { delay = 100ms; } --> toc.in;
tic.in <-- { delay = 100ms; } <-- toc.out;
}
network Tictoc2
{
submodules:
tic: Txc2 {
parameters:
@display("i=,cyan"); // do not change the icon (first arg of i=) just colorize it
}
toc: Txc2 {
parameters:
@display("i=,gold"); // here too
}
connections:
tic.out --> { delay = 100ms; } --> toc.in;
tic.in <-- { delay = 100ms; } <-- toc.out;
}
I want to now Is possible do that and how do it. Of course I can do:
[General]
[Config Tictoc1]
network = Tictoc1
[Config Tictoc2]
network = Tictoc2
But this will start separate simulations. I need this two in one.
Upvotes: 0
Views: 379
Reputation: 7002
In OMNeT++ there is no way to use more than one network simultaneously.
However, you can achieve your goal treating each your network as a compound module. In the tictoc1.ned
just change:
network Tictoc1
into module Tictoc1
network Tictoc2
into module Tictoc2
and add at the end of tictoc1.ned
:
network TicTocNet {
submodules:
network1: Tictoc1;
network2: Tictoc2;
}
In omnetpp.ini
set:
[General]
[Config TicTocNet]
network = TicTocNet
Upvotes: 1