ParkingArea
Asks for the value of a certain variable of the named ParkingArea.
The value returned is the state of the asked variable/value within the
last simulation step. Please note that for asking values from your
ParkingArea you have to define
them
within an additional-file and load them at the start of the simulation. The period and file
attributes do not affect TraCI.
The following variable values can be retrieved, the type of the return value is also shown in the table.
| Variable | ValueType | Description | Python Method |
|---|---|---|---|
| end pos | double | The end position of the stop along the lane measured in m. | getEndPos |
| lane ID | string | Returns the lane of this calibrator (if it applies to a single lane) | getLaneID |
| name | string | Returns the name of this stop | getName |
| start pos | double | The starting position of the stop along the lane measured in m. | getStartPos |
| vehicle count | integer | Get the total number of vehicles stopped at the named parking area. | getVehicleCount |
| vehicle ID | stringList | Get the IDs of vehicles stopped at the named parking area. | getVehicleIDs |
| accepted badges | stringList | Get the accepted badges for parking area access. | getAcceptedBadges |
Parameter retrieval (0x7e)#
Call traci.parkingarea.getParameter(parkingAreaID, key) to retrieve a string value.
| Key | Returned value |
|---|---|
capacity |
Total number of parking spaces. |
occupancy |
Number of occupied spaces, excluding reservations. SUMO discounts a vehicle waiting to leave when its departure is blocked and the area is full. |
reservationCount |
Number of vehicles holding advance reservations for this parking area. |
reservationIDs |
Vehicle IDs holding advance reservations, sorted lexicographically and separated by spaces. An empty string indicates that there are no advance reservations. |
A key outside this list retrieves the corresponding custom parameter. If the key is absent, the command returns an empty string.
capacity = int(traci.parkingarea.getParameter("parking1", "capacity"))
reserved_vehicles = traci.parkingarea.getParameter("parking1", "reservationIDs").split()