Hello all,
I am using SUMO as a base for a parking decision model. I have worked out most of the kinks in my model, but there is one error remaining that I haven't figured out how to work around. Occasionally, vehicles in my model will opportunistically choose to park at an available parking spot on the edge that they are currently on, rather than continue driving to their destination. All of the decisions are being taken on the first time step that a vehicle is on an edge, so generally I don't think the issue is that they are too far ahead of the parkingArea.
My code for this basically looks like:
if (parking spot available on current block & opportunistic parking decision):
traci.vehicle.changeLane(vehID,0,30) #change lanes to parking lane if necessary
traci.vehicle.replaceStop(vehID, 0, paCurrentEdge,duration = parking_duration,flags = 65) #set new parking target
I've tried a few other workarounds, such as using MoveTo to force the lane change (which also didn't seem to work) or MoveToXY to move the vehicle back to the beginning of the edge (which seemingly crashed my SUMO)
Does anybody have any ideas for how to accomplish what I'm looking for? Frankly some sort of close approximation would be acceptable as well (such as somehow teleporting directly into the parking spot on the same edge).
Thank you for your time,
Julian Abeledo