Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在NS-3中,如何分配节点id以及如何在终端中检索/显示它们?_Node.js_Network Programming_Ns2_Ns 3 - Fatal编程技术网

Node.js 在NS-3中,如何分配节点id以及如何在终端中检索/显示它们?

Node.js 在NS-3中,如何分配节点id以及如何在终端中检索/显示它们?,node.js,network-programming,ns2,ns-3,Node.js,Network Programming,Ns2,Ns 3,我想用它的唯一id显示20个节点。我用下面的命令使用for循环创建了20个节点 NodeContainer c; c.Create (20); int j; for(j = 0; j < 20; j++) { m.Install (c.Get(j)); } std::count << "Node Id: %d" << ??? <<std::endl; NodeContainer c; c、 创建(20); int j; 对于(j=0;j

我想用它的唯一id显示20个节点。我用下面的命令使用for循环创建了20个节点

NodeContainer c;
c.Create (20);
int j;
for(j = 0; j < 20; j++)
{   
  m.Install (c.Get(j));
}
std::count << "Node Id: %d" << ??? <<std::endl;
NodeContainer c;
c、 创建(20);
int j;
对于(j=0;j<20;j++)
{   
m、 安装(c.Get(j));
}
std::计数<代码>节点容器c;
c、 创建(20);
对于(uint32_t i=0;i<20;++i)
{
std::ostringstream os;
os NS-3:
 NodeContainer c;
 c.Create (20);
 for (uint32_t i = 0; i < 20; ++i)
 {
    std::ostringstream os;
    os << "node-" << i;   
 }