我是ns-3的新手,我正在尝试编辑示例third.cc以进行简单的仿真。但是我需要的比指定的还多。18个wifiStaNodes。但是,我不理解此代码片段来修改参数。
bility.SetPositionAllocator(“ ns3 :: GridPositionAllocator”,
"MinX", DoubleValue (0.0),
"MinY", DoubleValue (0.0),
"DeltaX", DoubleValue (5.0),
"DeltaY", DoubleValue (10.0),
"GridWidth", UintegerValue (3),
"LayoutType", StringValue ("RowFirst"));
有人可以解释一下网格的这种安排如何使仅创建18个节点成为可能吗?
您可以在以下src/mobility/model/constant-position-mobility-model.cc
说明中找到这些属性:
MinX= The x coordinate where the grid starts.
MinY = The y coordinate where the grid starts.
DeltaX= The x space between objects.
DeltaY= The y space between objects.
GridWidth= The number of objects laid out on a line.
LayoutType= The type of layout. (i.e., RowFirst or ColumnFirst)
基于GridWidth
对象的值,分别在每行/列中进行布局。在您的情况下,它将是6行,每行包含3个对象(节点)。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句