Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Retrieving remaining time at parking stops via TraCI

You can retrieve the time when the current stop was started with `traci.vehicle.getStopParameter(vehID, 0, "started").
Subtract this from simulation.getTime to obtain the stopping duration.
The minimum stopping duration and the until-time can be retrieved with `getStopParameter` where the parameter key is "duration" and "until" respectively.
All values are returned as string so you have to convert them to float in your code.
With these values you can compute the remaining duration as max(start + duration, until)
Note, that a stop may also be "triggered" in which case you cannot generally predict the remaining duration.

Am Mo., 15. Sept. 2025 um 12:52 Uhr schrieb Rohan Verma via sumo-user <sumo-user@xxxxxxxxxxx>:
Dear community,

I am currently working with parking areas in SUMO and using TraCI to monitor occupancy. For example, I use:

traci.parkingarea.getVehicleCount(parkingAreaID)

Since my parking spaces are configured with a capacity of 1, I can easily check if the spot is empty (0) or occupied (1).

What I would like to know is whether there is a way to obtain additional timing information about the parked vehicle. Specifically:

  • If a vehicle is occupying the parking space, can I query how much time remains for its parking stop to finish?

  • Alternatively, can I query how much time the vehicle has already spent at that stop?

I went through the TraCI documentation but could not find a direct function for this. Before I consider workarounds, I wanted to ask if there is a direct way to access this information through TraCI or another recommended approach.

Thank you very much for your help!

Kind regards,
Rohan

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top