Difference between revisions of "Specification/Persons"

From Sumo
Jump to navigation Jump to search
(Rides)
(trip chain example)
Line 94: Line 94:
 
==Stopping==
 
==Stopping==
 
The person stops for the maximum of ''currentTime+duration'' and ''until''.
 
The person stops for the maximum of ''currentTime+duration'' and ''until''.
 +
 +
=Example=
 +
The following is an example for a  person who walks to a train station, rides the train, alights and walks for a bit, then stops for an activity and finally gets into a car and drives away.
 +
 +
<pre class="xml">
 +
<routes>
 +
    <person id="person0" depart="0">
 +
        <walk from="2/3to1/3" to="1/3to0/3" departPos="80" arrivalPos="55"/>
 +
        <ride from="1/3to0/3" to="0/4to1/4" lines="train0"/>
 +
        <walk from="0/4to1/4" to="1/4to2/4" arrivalPos="30"/>
 +
        <stop lane="1/4to2/4_0" duration="20" startPos="40" actType="singing"/>
 +
        <ride from="1/4to2/4" to="3/4to4/4" lines="car0"/>
 +
    </person>
 +
 +
    <vehicle id="train0" depart="50">
 +
        <route edges="1/4to1/3 1/3to0/3 0/3to0/4 0/4to1/4 1/4to1/3"/>
 +
        <stop busStop="busStop0" until="120" duration="10"/>
 +
        <stop busStop="busStop1" until="180" duration="10"/>
 +
    </vehicle>
 +
 +
    <vehicle id="car0" depart="triggered">
 +
        <route edges="1/4to2/4 2/4to3/4 3/4to4/4" departPos="30"/>
 +
        <stop lane="1/4to2/4_0" duration="20" startPos="40" endPos="60"/>
 +
    </vehicle>
 +
 +
</routes>
 +
</pre>

Revision as of 12:50, 3 July 2013

Persons

A person moves through the net by walking or using vehicles. It has at least one plan as child element. If it has multiple plans it chooses one at random where the probability may be given in the plan definition. If the person has exactly one plan the explicit "plan" may be omitted, e.g.

<person id="x">
    <plan>
    ...
    </plan>
</person>

is equivalent to

<person id="x">
    ...
</person>
Attribute Type Range Default Remark
id string valid XML ids -
depart float(s) ≥0 -
type string any decelared vType
color rgb color

Visualization

Persons are rendered in the GUI with the configured detail-level. When assigning a type with attribute imgFile, the person may be rendered with an image. By default, the image will not be rotated (suitable for abstract icons). However, when setting the types guiShape="pedestrian" the image will be rotated according to the persons location and stage.

Plans

A plan is a sequence of trips and stops if it serves as a router input or of walks, rides and stops if it serves as simulation input.

Attribute Type Range Default Remark
probability float ≥0 1 this is only evaluated if a person has multiple plans, the probability values of all plans do not have to add to 1, they are scaled accordingly before choosing

Router input

The router input is still not completely defined. There has to be a possibility to define for the trips which vehicles / public transport lines may be used at all and for which vehicles the route can be defined / changed by the person.

Trips

Trips define the start and end point of a movement with optional changes in mode.

In definition they are identical to vehicles except for the missing route information (no route attribute and no route child is allowed). Instead they have the following attributes

Attribute Type Range Default Remark
from string valid edge ids - id of the start edge
to string valid edge ids - id of the destination edge
Note:
It is an error for subsequent trips to be unconnected.

Simulation input

Rides

Rides define the start and end point of a movement with a single mode of transport (e.g. a car or a bus). They are child elements of plan definitions.

Attribute Type Range Default Remark
from string valid edge ids - id of the start edge
to string valid edge ids - id of the destination edge
lines list valid line or vehicle ids - list of vehicle alternatives to take for the ride

the route to take is defined by the vehicle.

Walks

Walks define a pedestrian movement. They are child elements of plan definitions.

Attribute Type Range Default Remark
edges list valid edge ids - id of the edges to walk
duration float(s) >0 -
speed float(m/s) >0 -

The "edges" are traveled in the listed order. They do not need to be joined in the net. If they are not, a shortest path calculation is done between two consecutive list members. If there is no path connecting the two edges the linear distance is taken (this does not work yet. only listed edges contribute to travel time). At least one attribute of "speed" and "duration" has to be given. If both are given, the walk will last at least "duration" but it may take longer if the "speed" is low.

Stops

Stops define a delay until the next element of a plan is started. They can be used to model activities such as working or shopping. Stops for persons follow the specification at Specification#Stops. However, only the attributes lane, duration and until are evaluated. Using these attributes it is possible to model activities with a fixed duration as well as those with a fixed end time.

Simulation behavior

A person is starting her life at her depart time on the source (resp. first) edge of the first walk, ride or stop. She tries to start the next step of her plan.

Riding

The person checks whether a vehicle with a line from the given list is stopping at the given edge. If so, it enters the vehicle and starts the ride. It does not check whether the vehicle has the aspired destination on the current route. The first time the vehicle stops (on a well defined stop) at the destination edge, the ride is finished and the person proceeds with the next step in the plan.

Walking

The time to reach the last edge of the walk is calculated either from speed and length of the edges or directly from the duration given. The step is finished if the person reaches the last edge of the list.

Stopping

The person stops for the maximum of currentTime+duration and until.

Example

The following is an example for a person who walks to a train station, rides the train, alights and walks for a bit, then stops for an activity and finally gets into a car and drives away.

<routes>
    <person id="person0" depart="0">
        <walk from="2/3to1/3" to="1/3to0/3" departPos="80" arrivalPos="55"/>
        <ride from="1/3to0/3" to="0/4to1/4" lines="train0"/>
        <walk from="0/4to1/4" to="1/4to2/4" arrivalPos="30"/>
        <stop lane="1/4to2/4_0" duration="20" startPos="40" actType="singing"/>
        <ride from="1/4to2/4" to="3/4to4/4" lines="car0"/>
    </person>

    <vehicle id="train0" depart="50">
        <route edges="1/4to1/3 1/3to0/3 0/3to0/4 0/4to1/4 1/4to1/3"/>
        <stop busStop="busStop0" until="120" duration="10"/>
        <stop busStop="busStop1" until="180" duration="10"/>
    </vehicle>

    <vehicle id="car0" depart="triggered">
        <route edges="1/4to2/4 2/4to3/4 3/4to4/4" departPos="30"/>
        <stop lane="1/4to2/4_0" duration="20" startPos="40" endPos="60"/>
    </vehicle>

</routes>