我使用ns3来模拟无线数据中心。我使用" GridPositionAllocator"。
开始使用2d拓扑 MobilityHelper mobility;
mobility.SetPositionAllocator ("ns3::GridPositionAllocator",
"MinX", DoubleValue (0.0),
"MinY", DoubleValue (0.0),
"DeltaX", DoubleValue (1.0),
"DeltaY", DoubleValue (1.0),
"GridWidth", UintegerValue (8),
"LayoutType", StringValue ("ColumnFirst"));
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (wifiNodes);
如何将其更改为3d以将多个服务器放置在机架中?
答案 0 :(得分:0)
原则上,ns-3确实支持3D移动性,因为移动性矢量是3D(X,Y,Z),但是没有实现“PositionAllocator”。欢迎提供捐助。
一个简单的解决方案是扩展这个GridPositionAllocator,它假定Z = 0并用相应的MinZ,DeltaZ添加第三维。
答案 1 :(得分:0)
是的,但是添加带有网格位置分配器的3d拓扑是不可能的。 您可以使用ListPostionAllocator手动指定所有节点的位置。
您可以使用以下内容:
Ptr<ListPostionAllocator> lp =CreateObject<ListPostionAllocator>();
//Adding locations of 2 nodes
lp->ADD(Vector (10.0,10.0,10.0);
lp->ADD(Vector (20.0,20.0,20.0); //Add locations of all the nodes
mobHelper.SetpostionAllocator(lp);