【问题标题】:Why lane changing doesn't perform in sumo?为什么换道在相扑中不起作用?
【发布时间】:2021-12-15 10:49:31
【问题描述】:

我有一个简单的三车道网络,所有这些网络都在同一个方向。根据下面的代码,一辆应该经历变道的车辆进入一个空的网络,但没有任何反应。你能告诉我问题是什么吗?

def run():
    traci.start(sumoCmd)
    traci.vehicle.add('vehicle_0','route_1','emergency','50')
    traci.vehicle.changeLane('vehicle_0', '2', '10')
    step = 0
    while traci.simulation.step(100):           
        traci.simulationStep()
        print(step)
        step = 1
        step += 1
    traci.close()
    sys.stdout.flush()

【问题讨论】:

    标签: python sumo


    【解决方案1】:

    函数simulation.step 返回订阅结果,在您的情况下这是一个空列表(因为您没有任何订阅)。所以你的 while 循环会立即终止。

    【讨论】:

      猜你喜欢
      • 2021-09-16
      • 1970-01-01
      • 2013-05-14
      • 2017-10-30
      • 1970-01-01
      • 2021-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多