gpt4 book ai didi

omnet++ - 更改静脉中的 WSM(WAVE 短消息)数据包大小

转载 作者:行者123 更新时间:2023-12-04 03:01:04 25 4
gpt4 key购买 nike

是否通过 setWsmLength 设置 WSM 的长度或者通过 setWsmData 添加一个大的有效载荷在模拟过程中有什么区别吗?我正在尝试模拟一个经常使用的网络,但更改这两个值中的任何一个似乎都没有任何区别。我找到了 this ,但想确认这一点。如果我想更改 WSM 的大小,是否必须实现它?

最佳答案

您可以在 .msg 中为您的应用程序实现一个数据包。文件如下:

cplusplus {{
#include "veins/modules/messages/WaveShortMessage_m.h"
}}

class WaveShortMessage;

message MyAppsPacket extends WaveShortMessage {
string sourceAddress;
string destinationAddress;
simtime_t sendingTime;
}

然后在你的代码中你可以使用内置的 setByteLength() .使用 cPacket您的消息的子类,因为:

(cPacket is) A subclass of cMessage that can be used to represent packets (frames, * datagrams, application messages, etc). cPacket adds length (measured in * bits or bytes), bit error flag, and encapsulation capability to cMessage. * Length and bit error flag are significant when the packet travels through * a cDatarateChannel or another channel that supports data rate and/or * error modelling. *



相关 Q&A其中显示了来自 cMessage 的铸件至 cPacket .

关于omnet++ - 更改静脉中的 WSM(WAVE 短消息)数据包大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35564083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com