Demand/Activity-based Demand Generation

ActivityGen generates demand from a description of the population in the net. To do so, it uses a simple activity-based traffic model. It supports the activities work, school, and free time and the conveyances walking, bike, car, and bus. Cars may have their start or stop location outside the map.

Typical Command Line
activitygen --net-file  --stat-file  --output-file  --random

 is a map in form of a SUMO net file,  contains the description of the population (described below), and  is the generated SUMO routes file (the demand).

You can give ActivityGen a first try with the following example.

Example
While activitygen has been developed mainly to generate traffic demand for larger networks, this example features the small network shown in the image on the right. Download the files activitygen-example.net.xml and activitygen-example.stat.xml to follow this example.

To run this example, use the following commands:

activitygen --net-file activitygen-example.net.xml \ --stat-file activitygen-example.stat.xml \ --output-file activitygen-example.tmp.rou.xml \ --random duarouter --net-file activitygen-example.net.xml \ --route-files activitygen-example.tmp.rou.xml \ --output-file activitygen-example.rou.xml \ --remove-loops --ignore-errors --repair sumo --net-file activitygen-example.net.xml \ --route-files activitygen-example.rou.xml The first command generates the net file from the node and edge description. The second command generates the routes file (the demand) from a description of the population in the stat file. The generated routes are incomplete though. This will be changed in the coming weeks, but it allows you to choose the router you want for linking departure and destination edges. To use the SUMO's standard Dijkstra algorithm, you need to repair the route file executing the third command. Finally, you can run a traffic simulation with the SUMO main executable.

General information
First of all we need general information over the city.



The meanings of all these attributes are described in the following table:

Parameters
These entries are different from the general information element in what they describe. They depend much more of the special context or state of the city (events, behaviour of the population...). They can also be useful for optimization: the mean speed can be observed afterwards; all values can be changed in order to meet validation criteria on the traffic.

   

The meanings of all these attributes are described in the following table:

Population's Age Brackets
In order to distribute the population among households and in the city coherently, we need a precise age distribution of this population.

           ...       

Follows the description of all bracket attributes.

Work Hours
We need to specify the opening and closing hours of all city's work positions.

       ...

<workHours> <opening hour="30600" proportion="0.30" /> ...       <closing hour="43200" proportion="0.20" /> ...   </workHours>

Here are descriptions of all attributes of opening and closing elements:

Population and Work Position Distribution
Now, we have to specify the density of people and work in each street of the city. (by street I meant edges which are even more precise)

<general ... />   <parameters ... />   <bracket ... /> ...     <workHours> <opening ... /> ... <closing ... /> ... </workHours>

<street edge="abc123" population="2.5" workPosition="10.0" /> ...

Here are the corresponding attribute descriptions:

City Gates
In order to generate incoming and outgoing traffic, we need to specify gates to the city. Every gate will generate the same number of incoming (resp. outgoing) cars (the total number divided by the number of gates).

<general ... />   <parameters ... />   <bracket ... /> ...     <workHours> <opening ... /> ... <closing ... /> ... </workHours> <street ... /> ...

<cityGates> <entrance edge="abc123" pos="243.67" incoming="1.5" outgoing="2.2"/> <entrance edge="abc234" pos="0.00" incoming="1.0" outgoing="0.5"/> ...   </cityGates>

The corresponding attribute descriptions:

Schools
Children don't go to work but to school. The particularity of schools is that they are exactly positioned and receive many pupils every day.

<general ... />   <parameters ... />   <bracket ... /> ...     <workHours> <opening ... /> ... <closing ... /> ... </workHours> <street ... /> ...    <cityGates> <entrance ... /> ... </cityGates>

<school edge="123abc" pos="23.0" beginAge="12" endAge="18" capacity="400" opening="32400" closing="64800" /> ...

The corresponding attribute descriptions:

Bus Lines
People have a public bus line system to their disposition. This public transportation system is described by stations, different bus lines having their corresponding station for both directions and schedules.

<general ... />   <parameters ... />   <bracket ... /> ...     <workHours> <opening ... /> ... <closing ... /> ... </workHours> <street ... /> ...    <cityGates> <entrance ... /> ... </cityGates> <school ... /> ...

<busStations> <busStation id="1" edge="abc123" pos="456" /> <busStation id="2" edge="123cba" pos="324" /> ...   </busStations>

<busLines> <busLine id="601" maxTripDuration="3000"> <station refId="1" /> ...           <revStations> <station refId="2" /> ...           </revStations> <frequency begin="10000" end="25000" rate="1500" /> ...       </busLine> </busLines>

The corresponding attribute descriptions of all elements:

Final Aspect
Here is a complete example of a stat file:

<general inhabitants="45774" households="28200" childrenAgeLimit="18" retirementAgeLimit="65" carRate="0.58" unemploymentRate="0.05" footDistanceLimit="500" incomingTraffic="1500" outgoingTraffic="3000" />

<parameters carPreference="0.50" meanTimePerKmInCity="360" freeTimeActivityRate="0.15" uniformRandomTraffic="0.20" departureVariation="120" /> <bracket beginAge="0" endAge="30" peopleNbr="1765" /> <bracket beginAge="30" endAge="75" peopleNbr="1290" />

<workHours> <opening hour="30600" proportion="0.30" /> <opening hour="32400" proportion="0.70" /> <closing hour="43200" proportion="0.20" /> <closing hour="63000" proportion="0.20" /> <closing hour="64800" proportion="0.60" /> </workHours>

<street edge="-2779#2" population="4.0" workPosition="2.0" /> <street edge="-2776#0" population="3.5" workPosition="2.5" /> <street edge="-2950#15" population="1.3" workPosition="0" /> <cityGates> <entrance edge="-2950#15" pos="0.0" /> </cityGates>

<school edge="-2779#2" pos="23" beginAge="12" endAge="18" capacity="400" opening="32400" closing="64800" /> <school edge="-2779#2" pos="23" beginAge="3" endAge="12" capacity="150" opening="30600" closing="64800" /> <school edge="-2776#0" pos="765" beginAge="0" endAge="6" capacity="245" opening="32400" closing="61200" /> <busStations> <busStation id="1" edge="-2779#2" pos="456" /> <busStation id="2" edge="-2776#0" pos="324" /> <busStation id="3" edge="-2950#15" pos="233" /> </busStations>

<busLines> <busLine id="601" maxTripDuration="3000"> <station refId="2" /> <station refId="1" /> <revStations> <station refId="1" /> <station refId="2" /> </revStations> <frequency begin="21600" end="64800" rate="1200" /> <frequency begin="64800" end="84600" rate="1800" /> </busLine> </busLines>

Activities
ActivityGen takes into account two groups of activities, which are considered as most traffic-relevant: Work And School and Free Time. The activities within each group follow the same statistical rules.

Work and School Activities
This aggregate of activities contains the following activities:
 * 1) Going to work for adults (not retired), and
 * 2) Going to school for children.

That implies trips from home to work and the return trip for the drivers.

Free Time Activities
This aggregate of activities contains the following activities:
 * 1) Going out during the day (for retired or unemployed people)
 * 2) Going out in the evening (for all people who finished their work activity not too late)
 * 3) Going out late in the evening or in the night (for not retired adults having no children)

This activity is supposed to cover all car uses for:
 * Going out see friends
 * Doing sport
 * Visiting family
 * Party

Transportation Means
The population is distributed according to the statistics into households located in streets. People are likely to use different means of transportation in relation to their location, the availability of the different means and their destination. Three kind of Means are used in ActivityGen:<b> </b>
 * Feet or bike
 * Buses
 * Cars

All of them have their own possibilities and availability characteristics:

Feet or Bike
Trips by foot are available only for very short distances. But in this case, the person is very likely to go by foot. The bike isn't really used (buses and cars are preferred), it is supposed to serve in cases where none of the three means (Feet, buses and cars) are not available

Buses
Bus stations are located in the city corresponding to the real bus line network given in input (statistical data over the city). Someone enough close to a bus station and whose destination is enough close to another bus station is eligible for the public transportation means.

Cars
Householders having one or more cars can drive (not children) or be accompanied (escorted) by another adult who needs a car too. Children can only be accompanied (to school for example). Some households have no car, in this case they have to live enough close to a bus station. In the case of having a destination far from any bus station, they can go by foot or ride a bike. But this case doesn't generated any motorized vehicle traffic.