我正在尝试创建一个简单的消息定义,其中包含使用std::vector. 根据OMNet++ 5.5 手册 ch。6 秒。8.1,这看似简单。
但是,我使用的是 OMNet++ 6.0pre6:我无法弄清楚这样做的正确方法是什么,因为手册已经过时1,并且更改nedxml日志中非常肤浅地提到了这些更改。
消息定义可以归结为手册中的确切示例,但在这种情况下,它是 amessage而不是 a packet(两者都会产生相同的错误):
cplusplus {{
#include <vector>
typedef std::vector<int> IntVector;
}}
class noncobject IntVector;
message SimpleMsg {
int this_thing;
int that_thing;
IntVector these_things;
}
Run Code Online (Sandbox Code Playgroud)
以下错误由opp_msgtool消息到 C++ 转译器提供:
SimpleMsg.msg:6: Error: Type declarations are not needed with imports, try invoking the message compiler in legacy (4.x) mode using the --msg4 option
SimpleMsg.msg:11: Error: unknown type …Run Code Online (Sandbox Code Playgroud) 我正在尝试计算Veins-LTE中SimpleServerApp的端到端延迟,我无法得到任何结果,当我打开结果文件时,所有与延迟相关的统计数据都是0或NaN.
我查看了Tic-Toc教程并尝试做类似的事情,但这样我甚至没有得到统计数据:
在模块上:
delayVector.record(delay);
delayHist.collect(delay);
Run Code Online (Sandbox Code Playgroud)
当调用finish()时:
delayHist.recordAs("delayFinish");
Run Code Online (Sandbox Code Playgroud)
哪里
simtime_t delay;
cOutVector delayVector;
cLongHistogram delayHist;
Run Code Online (Sandbox Code Playgroud)
然后我尝试从其他统计记录中复制该程序,但我认为不能在我的情况下使用,因为我想发送一个长:
在NED文件上:
@signal[delay](type="long");
@statistic[delay](title="delay"; source="delay"; record=vector, stats, histogram);
Run Code Online (Sandbox Code Playgroud)
在模块上:
emit(delay,delay); //where the first delay is the signal and the second one, the value.
Run Code Online (Sandbox Code Playgroud)
这就是我计算延迟的方法:
在发送模块上:
msg->setSendingTime();
Run Code Online (Sandbox Code Playgroud)
在接收模块上:
simtime_t delay = simTime() - msg->getSendingTime();
Run Code Online (Sandbox Code Playgroud)
我很感激任何帮助!
我想访问在inet框架中使用移动模型的移动节点的位置和速度.我以前使用MobilityAccess.h库来使用表单中定义的方法
MobilityAccess().get(module)->getCurrentPosition()
Run Code Online (Sandbox Code Playgroud)
这种方法可用于inet 2.6框架.我需要使用更新版本inet 3.2.1,但在此版本MobilityAccess.h库中不存在或移动到其他地方.
我检查了inet 3.2.1文件夹,还有base文件夹,而不是common曾经是在文件夹中inet 2.6的文件夹mobility中src.
有没有办法让移动节点的位置inet 3.2?
我想知道如何在静脉2.0下正确设置节点的传输范围,我认为我做得对,但我害怕是错的.
所以,我需要对*.ini文件中定义的参数进行一些澄清:
*.connectionManager.pMax = 24.34mW # =>>> parameters to set the max interference distance by the global manager module
*.connectionManager.sat = -80dBm # =>>> parameters to set the max interference distance by the global manager module
*.**.nic.phy80211p.maxTXPower = 24.34mW # =>>> what is the role of this parameter ? is it affecting the transmission range or only limiting the max TX Power ?
*.**.nic.mac80211p.txPower = 13.69mW # =>>> is it the parameter along to sensitivity that are responsible of changing …Run Code Online (Sandbox Code Playgroud) 我刚刚实现了这个类:
class MIXIM_API DSRCmsgID : public cObject
{
public:
/** @brief Constant with all values set to 0. */
static const DSRCmsgID ZERO;
public:
//int msgID;
enum msgID {
DSRCmsgID_reserved = 0,
DSRCmsgID_alaCarteMessage = 1,
DSRCmsgID_DSRCmsgID = 2,
DSRCmsgID_DSRCmsgIDVerbose = 3,
DSRCmsgID_commonSafetyRequest = 4,
DSRCmsgID_emergencyVehicleAlert = 5,
DSRCmsgID_intersectionCollisionAlert = 6,
DSRCmsgID_mapData = 7,
DSRCmsgID_nmeaCorrections = 8,
DSRCmsgID_probeDataManagement = 9,
DSRCmsgID_probeVehicleData = 10,
DSRCmsgID_roadSideAlert = 11,
DSRCmsgID_rtcmCorrections = 12,
DSRCmsgID_signalPhaseAndTimingMessage = 13,
DSRCmsgID_signalRequestMessage = 14,
DSRCmsgID_signalStatusMessage = 15,
DSRCmsgID_travelerInformation = 16 …Run Code Online (Sandbox Code Playgroud) 我是VEINS的新手,正在尝试在MyVeinsApp.cc中实现加权p持久性。该公式中使用了发送节点和接收节点之间的距离。我看到了下面的两个功能。
virtual Coord& getSenderPos();
virtual const Coord& getSenderPos() const {return const_cast<WaveShortMessage*>(this)->getSenderPos();}
Run Code Online (Sandbox Code Playgroud)
我应该使用其中一种方法来计算节点之间的距离吗?
请建议最好的方法。
对于使用 [] 表示法添加任意数量模块的模拟,ned 文件突然损坏了。例如,在 tictoc10.ned 中,tic[6]:Txc10 在设计抽头上显示 tic[6],而不是六个 tic 模块。我重新安装了 omnet++,一旦我打开 tictoc 教程的 ned 文件,ned 就会损坏,这包括所有其他示例。见附图tictoc10.ned
我需要从头开始构建一个方案。在直路上行驶的两辆车。有一个RSU。rsu每10秒广播一次速度值。车辆应减速以达到该值。
我的问题是我可以将味精视为信标吗?如果是,如何在rsu应用程序中设置信标msg?如果没有,如何实现这种情况
我是 VEINS/Omnet++ 的新手,正在尝试各种广播抑制技术,并且想计算丢包率。我想我必须使用这个公式:
丢包率 = TotalLostPackets / SentPackets
但由于某些节点发送 0 个数据包,是否有一种简单的方法可以在 Omnet++ .anf 配置文件中或在 VEINS 中指定这一点,而无需进行手动调整?否则,如果任何节点发送 0 数据包,则所有图都显示为无穷大。
谢谢你!
我一直在研究TraciDemo11p,并不能清楚地理解stage的含义。
void TraCIDemo11p::initialize(int stage)
{
DemoBaseApplLayer::initialize(stage);
if (stage == 0) {
sentMessage = false;
lastDroveAt = simTime();
currentSubscribedServiceId = -1;
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用inet v3.4.0.我正在尝试创建一个移动模型.但每当我创建任何类型的std :: vector时,它都会随机大小初始化.
初始化时,它永远不会有零大小.这应该发生吗?因为从C++向量,我看到在创建向量时,例如
std::vector <int*> a;
Run Code Online (Sandbox Code Playgroud)
a 应该有一个大小为零.
omnet++ ×11
c++ ×4
veins ×4
inet ×2
sumo ×2
beacon ×1
enums ×1
networking ×1
simulation ×1
vector ×1