1

我正在尝试连接 inet 3.4.0 和静脉 4.4 以获得 Tcp/Ip 支持。我已经遵循了这些说明(静脉 - INET 兼容性)甚至更多,但在尝试运行模拟时出现此错误:我不确定是否理解 TraCIMobility 函数。

<!> Error in module (Veins::TraCIScenarioManagerLaunchd) simple_junction_noTls_ipv4.manager (id=6) at event #23, t=0.2: ASSERT: condition lastUpdate != simTime() false in function changePosition, veins/modules/mobility/traci/TraCIMobility.cc line 192.

这是我的汽车模块:

import inet.node.inet.AdhocHost;
import org.car2x.veins.base.modules.*;
import org.car2x.veins.modules.nic.Nic80211p;
import org.car2x.veins.base.modules.IMobility;

module Car extends AdhocHost
{
    parameters:
    //string applType; //type of the application layer
    int numWaveRadios = default(1);          
    string nicType = default("Nic80211p"); // type of network interface card
    string veinsmobilityType; //type of the mobility module
    string imobilityType; //type of the mobility module
    @display("bgl=2");
gates:
    input veinsRadioIn[numWaveRadios] @directIn; // gate for sendDirect

submodules:
    nic[numWaveRadios]: <nicType> like org.car2x.veins.modules.nic.INic80211p {
        parameters:
            @display("p=661,287");
    }

    veinsmobility: <veinsmobilityType> like org.car2x.veins.base.modules.IMobility {
        parameters:
            @display("p=163,242;i=block/cogwheel");
    }
    // optional mobility module. Required only if ieee80211p wireless cards are present
    imobility: <imobilityType> like org.car2x.veins.base.modules.IMobility if (imobilityType != ""){
        parameters:
            @display("p=53,200");
    }  
connections:
    for i=0..sizeof(veinsRadioIn)-1 {
        veinsRadioIn[i] --> { @display("m=s"); } --> nic[i].radioIn;
        nic[i].upperLayerOut --> networkLayer.ifIn++;
        nic[i].upperLayerIn <-- networkLayer.ifOut++;
    }

}

这是我的配置文件 omnetpp.ini 的一部分:

###########################################################
##                      Mobility                          #
###########################################################
*.node[*].veinsmobilityType ="org.car2x.veins.modules.mobility.traci.TraCIMobility"
*.node[*].imobilityType = "TraCIMobility"
*.node[*].imobilityType.debug = true
*.node[*].veinsmobilityType.debug = true
*.node[*].veinsmobility.x = 0
*.node[*].veinsmobility.y = 0
*.node[*].veinsmobility.z = 1.895
*.node[*].imobility.x = 0
*.node[*].imobility.y = 0
*.node[*].imobility.z = 1.895

感谢您的帮助!问候,

4

2 回答 2

1

Github 上的 Veins 存储库现在包含一个示例子项目 ( veins_inet),该子项目使用 Veins 运行 INET Framework (INET 3.4.0) 模拟以实现节点的移动性。

您可以在https://github.com/sommer/veins/commit/90d4586e上查看必要的代码(点击 后Browse Files,您可以下载完整项目的 .zip 存档)

于 2017-01-24T16:41:43.237 回答
0

OK I've commented the assertion

// ensure we're not called twice in one time step

//ASSERT(lastUpdate != simTime());

with INET we are effectively called twice, one here and one from TraCIScenarioManagerInet.cc, hence I comment this line

It runs now...but called twice in one time step

于 2016-09-23T09:33:36.357 回答