Dynamic boarding duration
I want to implement a scenario in SUMO where the dwell time of a bus at a stop is determined by the number of passengers at that stop. If there are many passengers, the bus waits longer; if there are few, it waits for a shorter time. So I do not want to predefine the duration or util parameters in the rou.xml file.
After reviewing the official documentation, it seems that this could be achieved by setting "triggered=True" and specifying the "expected" or "permitted" parameters (for example, expected="passenger_1"). I made an initial attempt based on this approach, but it still does not achieve the effect I want.
When I was experimenting, the setup was as follows:
-
The bus stop is located at: "busStop id="bs_0" lane="-E1_1" startPos="210.63" endPos="220.63" lines="busline_0" "
-
The person defined in my .rou.xml is like: depart="0" departPos="200" id="passenger_1" walk arrivalPos="215" from="-E1" to="-E1" ride from "-E1" to="E6" lines="busline_0"
-
The bus defined in my .rou.xml is like: depart="0" departLane="1" id="cab_1" lines="busline_0" route="-E1 -E0 E6" stop busStop="bs_0" triggered="person"
-
I advanced the simulation in the simplest way and tried setting some parameters related to bus stopping. The method is: “traci.vehicle.setBusStop( vehID="cab_1", stopID="bs_0", flags= tc.STOP_TRIGGERED ) traci.vehicle.setStopParameter( vehID="cab_1", nextStopIndex=0, param="permitted", value="passenger_1" )”
-
I ran the simulation based on these parameters, but I found that cab_1 keeps stopping at bs_0, even though passenger_1 is already within the coordinates of bs_0 and has been waiting for a long time, as shown in the figure below. (At this time, passenger_1's position is 215, while bs_0’s coordinates are startPos="210.63" and endPos="220.63".)
In the simulation, I also defined many other pedestrians, but it seems that none of them board the bus. Like passenger_1, they all keep waiting at position 215, which in turn causes cab_1 to remain stopped indefinitely. I am not sure where the problem lies and look forward to your explanation.
it is already the case that dwell times are prolonged by boarding/unboarding actions according to the vehicle type parameter boardingDuration.
This can be freely combined with until (the earliest planned departure) and duration (the minimum stopping duration).
If you are not seeing the effect do any of the following:
- reduce minimum stopping duration
- make sure, the vehicle doesn't arrive too early (persons start boarding as soon as the vehicle stops)
- increase
boardingDuration - increase the number of boarding persons
To monitor the increase and decrease in planned stopping duration at runtime see https://sumo.dlr.de/docs/sumo-gui.html#showing_routes_and_route-related_information