在 VEINs 框架中为 Nakagami 模型自定义衰落参数

问题描述 投票:0回答:0

我想在我的静脉模拟中使用 nakagami 模型和衰落参数 L 这样;当发送器和接收器之间的距离(Dij)小于50m时L=3,当50m≤Dij≤150m时L=1.5,当Dij≥150m时L=1。发送方和接收方 (Dij) 之间的距离是在我的每个节点的主应用程序的 onBSM 函数中获得的。

void TimeBarrierApp::onBSM(DemoSafetyMessage *bsm) {
    // Your application has received a beacon message from another car or RSU
    // code for handling the message goes here

    double senderPOx = bsm->getSenderPos().x;
    double senderPOy = bsm->getSenderPos().y;
    double senderPOz = bsm->getSenderPos().z;

    double senderSpeed = bsm->getSenderSpeed().length();

    double Dx = senderPOx - curPosition.x;
    double Dy = senderPOy - curPosition.y;


    double Distance = sqrt((Dx * Dx) + (Dy * Dy));

    }

定义传播模型的 congig.xml 文件;定义两个参数 alpha 和 omega 使得;

<root>
    <AnalogueModels>
        <AnalogueModel type="NakagamiFading">
        <parameter name="alpha" type="double" value="1.0"/>
        <parameter name="omega" type="double" value="1.0"/>
    </AnalogueModel>
    </AnalogueModels>
    <Decider type="Decider80211p">
        <!-- The center frequency on which the phy listens-->
        <parameter name="centerFrequency" type="double" value="5.890e9"/>  
    </Decider>
</root>

现在我如何自定义这个模型,使衰落参数取决于发送方和接收方之间的距离而不是 alpha 和 omega 参数?

omnet++ veins
© www.soinside.com 2019 - 2024. All rights reserved.