有没有办法强制 SUMO 每 X 秒加载一次车辆(时间步长)

Is there way to force SUMO to load vehicles every X seconds (time steps)

我正在使用规划器来规划车辆路线,我每 X 秒(通常是 20)创建一次计划,为此我需要车辆在进入网络之前加载(例如从时间 0 到 20)。现在我通过解析 routes.rou.xml 文件来完成此操作,但我希望能够使用 TraCI 来完成此操作。

我读于:https://sumo.dlr.de/docs/Simulation/VehicleInsertion.html, that vehicles are loaded in chunks, but by setting "--route-steps 0" i can load all vehicles at once (all of them are in traci.simulation.getLoadedIDList() at time step 0), which is not ideal for longer simulation with thousands of cars, but even with the vehicles loaded, I am unable to find any function to retrieve their time of departure. At: https://sumo.dlr.de/docs/TraCI/Vehicle_Value_Retrieval.html#Device_and_LaneChangeModel_Parameter_Retrieval_0x7e 我没有找到任何与车辆出发时间对应的变量和 traci.vehicle.getParameter(vehicle_id, 'depart') returns 空字符串。

所以我想知道如何强制 SUMO 每 X 秒(时间步长)加载一次车辆,或者使用 TraCI 查找车辆的出发时间(通过其 ID 找到)。

如果我对你的问题的理解正确,你想强制 sumo 始终提前读取路线文件至少 X 秒,并通过 traci 检索预期的出发时间。恐怕这两件事目前都不可能。您提到的 --route-steps 允许以某种方式配置前瞻,但仅定义相扑读取的块大小,因此 --route-steps 100 将首先读取 0 到 100,然后读取 100 到 200,依此类推。因此,大多数时候您可能会进行必要的展望,但并非总是如此。此外,您还不能通过 traci 检索预定的出发时间,但至少有一个开放的机票:https://github.com/eclipse/sumo/issues/7693。也许在那里发表评论,以便人们知道它仍然需要。不幸的是,在那之前解析路由文件是您唯一的选择。