Omnet++ 门未连接到子模块错误
我正在尝试创建一个包含六个节点的网络,如下所示Omnet++ 门未连接到子模块错误,omnet++,Omnet++,我正在尝试创建一个包含六个节点的网络,如下所示 module Node { parameters: @display("i=abstract/router_vs"); gates: inout g[]; } channel Link extends ned.DatarateChannel { parameters: int cost = default(0); } // // Generated network with
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++;
}
模块节点
{
参数:
@显示(“i=摘要/路由器”);
盖茨:
inout g[];
}
通道链接扩展了ned.DatarateChannel
{
参数:
整数成本=默认值(0);
}
//
//生成具有随机拓扑的网络(6个节点,8条边,种子=100)。
//
网络
{
@显示(“bgb=478329”);
子模块:
S:节点{
@显示(“p=19,87;is=s”);
}
n1:节点{
@显示(“p=130142;is=s”);
}
n2:节点{
@显示(“p=130,36;is=s”);
}
n3:节点{
@显示(“p=262142;is=s”);
}
n4:节点{
@显示(“p=262,36;is=s”);
}
T:节点{
@显示(“p=364,87;is=s”);
}
连接:
S.g++链接{cost=13;@display(“t=13”);}n1.g++;
S.g++链接{cost=16;@display(“t=16”);}n2.g++;
n1.g++链接{cost=1;@display(“t=1”);}n2.g++;
n1.g++链接{cost=14;@display(“t=14”);}n3.g++;
n1.g++链接{cost=9;@display(“t=9”);}n4.g++;
n2.g++链接{cost=12;@display(“t=12”);}n4.g++;
n4.g++链接{cost=20;@display(“t=20”);}t.g++;
n3.g++链接{cost=4;@display(“t=4”);}t.g++;
n3.g++链接{cost=7;@display(“t=7”);}n4.g++;
}
但是当我试图运行模拟器时,它使exe文件崩溃,我得到了这个错误
网络设置期间模块(cModule)net.S(id=2)出错:Gate
`net.S.g$i[0]”未连接到子模块(或内部连接到
同一模块的另一个闸门)
问题出现在
模块节点中,您将其声明为复合模块。因此,OMNeT++希望它有子模块连接到声明的gateg
。但是,复合模块没有子模块
您很可能希望将模块声明为简单节点
(即,没有子模块的模块)