Day activity schedule - smart-fm/simmobility-prod GitHub Wiki

In our model, each individual performs in a day a sequence of activities, like working, attending classes at school, shopping, etc.

The preday component of SimMobility MT outputs the Day Activity Schedule (DAS) to the within-day and supply simulator. The day activity schedule is basically a list of activities made by each person in a day along with additional information for each activity to infer the trip made for that activity. This document explains the structure of the day_activity_schedule table that is output from preday and provides some additional notes for better understanding of how the DAS is used.

# column datatype explanation
01 person_id string person id
02 tour_no integer
03 tour_type string Work/Education/Shop/Other
04 stop_no integer
05 stop_type string Work/Education/Shop/Other/Home
06 stop_location integer SimMobility node id
07 stop_zone integer zone code for TAZ chosen from Preday
08 stop_mode string the mode of travel opted by the person to arrive at this activity location
09 primary_stop boolean whether this stop is the primary stop of tour
10 arrival_time numeric Start time of the activity. Each of the numbers (3 to 26).(25 or 75) represent the midpoint of each half-hour window of the day starting from 3AM. E.g. 4.75 represents [4:30,4:59] AM window.
11 departure_time numeric End time of the activity
12 prev_stop_location integer SimMobility node id, so we know the trip origin to arrive at this activity location
13 prev_stop_zone integer zone code for TAZ where the previous stop was located
14 prev_stop_departure_time numeric End time of the last activity.
15 pid serial unique id for each record of the table

Notes

  1. Preday populates this table. The table includes both the primary and intermediate stops of all tours of every person. The values of tour_no and stop_no columns represent the chronological ordering of the tours and stops in the day.

  2. Every record of the day activity schedule table corresponds to exactly one activity of a person and the trip performed by that person to arrive at that activity location. Within-day will infer a trip for this person from prev_stop_location to stop_location and there will be an activity at the stop_location.

  3. Preday operates at TAZ level. We have a mapping of every postcode to a TAZ and a mapping of every postcode to SimMobility node. The assignment of nodes (for columns stop_location and prev_stop_location) is done as follows.

    • For work and education activities for which the activity destination is known in terms of postcode from the population data, we directly fetch the SimMobility node mapped to the postcode.
    • For shopping, other and work activities with unspecified activity destination, we choose a random postcode which is mapped to the TAZ chosen by Preday and select the node which is mapped to that postcode.
  4. The arrival and departure times are a 30 minute window of the day. Since we do not have any model for departure time choice yet, withinday assigns a random time within the 30 minute window to be the actual departure time for a trip.

  5. Within-day loads the activity schedules periodically for every one hour during simulation. At the start of every hour of the simulation, the entire activity schedule of all persons whose first trip of the day fall within that hour is loaded into the simulation. To be more precise, all rows of day activity schedule table with person_id=’x’ will be read just before the start of the next period [ta,tb), where tb - ta = 1 hour, if and only if the row with person_id=’x’, tour_no=1, stop_no=1 has prev_stop_departure_time >= ta and <= tb.

  6. Each person in the table has a row with stop_type=’Home’ which represents the end of a tour. The ‘Home’ activity corresponding to the last tour of the person will not be executed by supply.

  7. When withinday translates the day activity schedules to withinday, the pre-trip route choices are done for the first trip of the first tour. The route choice provides necessary information for the subtrips to be constructed for the first trip. For example, if the first trip is by 'Car' stop_mode, a private traffic route choice is performed and the trip will consist of a single subtrip with 'Car' mode. On the other hand, if the first trip is by a PT stop_mode, a public transit route choice is done which returns adequate details about the individual legs for access, PT, transfers and egress legs each of which becomes a separate sub-trip of the same PT trip.

This DAS is supplied to the simulation through day_activity_schedule element under proc_maps in the simrun_MidTerm.xml file.
<mapping name="day_activity_schedule" procedure="get_persons" />
Here, get_persons is the stored procedure that is used to access the Day Activity Schedule table.