gpt4 book ai didi

omnet++ - 门未连接到子模块错误

转载 作者:行者123 更新时间:2023-12-04 13:48:30 25 4
gpt4 key购买 nike

我正在尝试创建一个具有六个节点的网络,如下所示

module Node
{
parameters:
@display("i=abstract/router_vs");
gates:
inout g[];

}

channel Link extends ned.DatarateChannel
{
parameters:
int cost = default(0);
}

//
// Generated network with random topology (6 nodes, 8 edges, seed=100).
//
network net
{
@display("bgb=478,329");
submodules:
S: Node {
@display("p=19,87;is=s");
}
n1: Node {
@display("p=130,142;is=s");
}
n2: Node {
@display("p=130,36;is=s");
}
n3: Node {
@display("p=262,142;is=s");
}
n4: Node {
@display("p=262,36;is=s");
}
T: Node {
@display("p=364,87;is=s");
}
connections:
S.g++ <--> Link { cost = 13;@display("t=13"); } <--> n1.g++;
S.g++ <--> Link { cost = 16;@display("t=16"); } <--> n2.g++;
n1.g++ <--> Link { cost = 1;@display("t=1"); } <--> n2.g++;
n1.g++ <--> Link { cost = 14;@display("t=14"); } <--> n3.g++;
n1.g++ <--> Link { cost = 9;@display("t=9"); } <--> n4.g++;
n2.g++ <--> Link { cost = 12;@display("t=12"); } <--> n4.g++;
n4.g++ <--> Link { cost = 20;@display("t=20"); } <--> T.g++;
n3.g++ <--> Link { cost = 4;@display("t=4"); } <--> T.g++;
n3.g++ <--> Link { cost = 7;@display("t=7"); } <--> n4.g++;
}

但是当我尝试运行模拟器时出现此错误并且它使 exe 文件崩溃。

Error in module (cModule) net.S (id=2) during network setup: Gate `net.S.g$i[0]' is not connected to a submodule (or internally to another gate of the same module).

最佳答案

问题出在module Node ,您将其声明为复合模块。因此,OMNeT++ 期望它具有连接到声明门 g 的子模块。 .但是,您的复合模块没有子模块。

您很可能希望将您的模块声明为 simple Node (即没有子模块的模块)。

关于omnet++ - 门未连接到子模块错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30966676/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com