一次模拟中的多个网络(如何配置ini)

问题描述 投票:0回答:1

我有两个网络。例如,我在一个Tictok1文件中使用教程Tictok2.ned。如何在一次模拟中运行它?我试着在google找到最近两天的解决方案。

我被尝试配置像:

[General]
network = Tictoc1,Tictoc2

要么

[General]
network = Tictoc1;Tictoc2

tictoc1.ned文件:

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;
}

我想现在可以这样做,怎么做。我当然可以这样做:

[General]
[Config Tictoc1]
network = Tictoc1
[Config Tictoc2]
network = Tictoc2

但这将开始单独的模拟。我需要这两个一个。

networking ini omnet++
1个回答
1
投票

在OMNeT ++中,无法同时使用多个网络。 但是,您可以实现将每个网络视为复合模块的目标。在tictoc1.ned只是改变:

  • network Tictoc1进入module Tictoc1
  • network Tictoc2进入module Tictoc2

并添加在tictoc1.ned的末尾:

network TicTocNet {
    submodules:
      network1: Tictoc1;
      network2: Tictoc2;
}

omnetpp.ini集:

[General]
[Config TicTocNet]
network = TicTocNet 
© www.soinside.com 2019 - 2024. All rights reserved.