如何在NS3内部将包装颜色设置为netanim
AnimationInterface anim("DDoSim.xml");
ns3::AnimationInterface::SetConstantPosition(nodes.Get(0), 0, 0);
ns3::AnimationInterface::SetConstantPosition(nodes.Get(1), 10, 10);
ns3::AnimationInterface::SetConstantPosition(nodes.Get(2), 23, 10);
anim.UpdateNodeColor(nodes.Get(0), 0, 0, 255);
uint32_t x_pos = 0;
for (int l = 0; l < NUMBER_OF_BOTS; ++l)
{
ns3::AnimationInterface::SetConstantPosition(botNodes.Get(l), x_pos++, 30);
}
默认情况下,模拟中的所有数据包均以蓝色显示。 我希望该数据包源自模拟中的节点0,以与植物瘤不同的颜色显示不同的颜色,表明它可以很容易地看到哪些数据包来自Node0,哪些数据包来自botnodes。
有什么办法可以实现这一目标?
AnimationInterface anim("DDoSim.xml");
ns3::AnimationInterface::SetConstantPosition(nodes.Get(0), 0, 0);
ns3::AnimationInterface::SetConstantPosition(nodes.Get(1), 10, 10);
ns3::AnimationInterface::SetConstantPosition(nodes.Get(2), 23, 10);
anim.UpdateNodeColor(nodes.Get(0), 0, 0, 255);
uint32_t x_pos = 0;
for (int l = 0; l < NUMBER_OF_BOTS; ++l)
{
ns3::AnimationInterface::SetConstantPosition(botNodes.Get(l), x_pos++, 30);
}
By default all the packets in the simulation are shown in blue color.
I want the packet originating from node 0 in the simulation to be shown with different color than originating from botnodes, show that it can be easily seen which packets are from node0 and which are from botNodes.
Is there any way I can achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法做到。您只能更改节点的颜色,而不能更改数据包。
There is no way you can do so. You can only change the color of nodes, but not packets.