我正在使用 OMNET++ 进行位置隐私项目,最近我开发了一个由两个节点组成的网络(如 Tic-Toc 游戏),并希望将其转换为一个真实的网络,根据用户要求从 2 到 n 个节点不等。
这是2个节点的结构:
simple Txc1
{
gates:
input in;
output out;
}
`enter code here`// Two instances (tic and toc) of Txc1 connected both ways.
// Tic and toc will pass messages to one another.
//
network Tictoc1
{
submodules:
tic: Txc1;
toc: Txc1;
connections:
tic.out --> { delay = 100ms; } --> toc.in;
tic.in <-- { delay = 100ms; } <-- toc.out;
}
我怎样才能为 n 个节点做到这一点?我的意思是如何在 OMNET++ 中输入 n(来自用户)?
请任何人...