在我的模拟中,我需要将一辆汽车停在停车场,当汽车离开停车场时,它会将它们的信息传输到parking.Therefore内部的其余汽车,当车辆停在停车场时,它与停车场外部或内部的通信不应中断。
我使用的是omnetpp-5.0、sumo-0.25.0和veins veins 4.4。我尝试将更改应用到基础纹理,但我没有得到结果。
我怎样才能在不中断与停车场内外通信的情况下停车?
有谁可以帮我?
发布于 2019-01-05 20:08:44
我不是静脉方面的专家,所以我只能代表相扑方面发言。你可以简单地在车辆路线上添加一个停靠点,并像这样标记它是一个停车位:
<vehicle id="1" depart="0">
<route edges="edge1 edge2"/>
<stop lane="edge2_0" endPos="100" duration="100" parking="true"/>
</vehicle>如果由于停车将车辆从网络中移除,因此可能会因为不再有可靠位置而禁用通信,因此无法工作,则在网络中创建一条单独的街道:
<vehicle id="1" depart="0">
<route edges="edge1 edge2a parking edge2b"/>
<stop lane="parking_0" endPos="100" duration="100"/>
</vehicle>其中“停车”至少比edge2多一条车道,这样车辆就可以超车。(我在没有测试的情况下从内存中编写了这个示例,因此其中可能存在错误。)
发布于 2021-08-07 05:04:45
下面的摘录可能会有所帮助,因为它演示了一辆在临时停车(模拟停车)的车辆。有关详细信息,请查看veins中的TraCIMobility.cc
void TraCIMobility::handleSelfMsg(cMessage *msg)
{
if (msg == startAccidentMsg) {
commandSetSpeed(0);
simtime_t accidentDuration = par("accidentDuration");
scheduleAt(simTime() + accidentDuration, stopAccidentMsg);
accidentCount--;
}
else if (msg == stopAccidentMsg) {
commandSetSpeed(-1);
if (accidentCount > 0) {
simtime_t accidentInterval = par("accidentInterval");
scheduleAt(simTime() + accidentInterval, startAccidentMsg);
}
}
}https://stackoverflow.com/questions/54005127
复制相似问题