Search code examples
sumo

Generating pedestrian flow with constant speed in SUMO


I am generating pedestrian flow using <personFlow>, and I want each pedestrian to walk in a constant speed while each pedestrian has a different speed than the other pedestrians.
When I use the attribute speed in <walk>, each pedestrian walks in a variable speed but the maximum speed is equal to "1.2" as specified.
My question is: What can I write to make the generated pedestrians walk in a constant speed and multiple pedestrians have different speeds at the same time?

Here is my route file:

<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    <personFlow id="ped" begin="60" end="500" probability="0.05">
       <walk from="-E0.51" to="E0.51" speed="1.2"/>
    </personFlow>
</routes>

Solution

  • You can only give the maximum speed here because usually pedestrians may need to react to others or to traffic lights and this will influence their speed. To give a distribution on maximum speed you can define different vTypes (despite the name they apply to pedestrians as well) and choose from a distribution.

    ...
    <vTypeDistribution id="p">
        <vType id="p1" vClass="pedestrian" maxSpeed="1"/>
        <vType id="p2" vClass="pedestrian" maxSpeed="2"/>
    </vTypeDistribution>
    
    <personFlow id="ped" type="p" begin="60" end="500" probability="0.05">
    ...