我正在尝试连接inet 3.4.0和veins 4.4以获得Tcp / Ip支持。 我已按照这些说明(Veins - INET compatibility)甚至更多,但在尝试运行模拟时遇到此错误:我不确定是否了解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
谢谢你的帮助! 的问候,
答案 0 :(得分:0)
好的我已经评论了断言
//确保我们不会在一个时间段内调用两次
//ASSERT(lastUpdate != simTime());
使用INET我们实际上被调用了两次,一次来自TraCIScenarioManagerInet.cc,因此我对此行进行了评论
它现在运行......但是一次性调用两次
答案 1 :(得分:0)
Github上的Veins存储库现在包含一个示例子项目(veins_inet
),该子项目运行INET Framework(INET 3.4.0)模拟,使用Veins for nodes&#39;迁移率。
您可以在https://github.com/sommer/veins/commit/90d4586e
上看到必要的代码(并在点击Browse Files
后,可以下载完整项目的.zip存档)