# Generating Activity-Based Mobility Plans from Trip-Based Models and Mobility Surveys
## 3 Materials and Methods
### Approach
#### 3.3.2 Derive the Activity Chains  
An activity chain is a sequence of activity types throughout one day without any associated locations or timestamps. Due to the significant effort of creating realistic activity sequences [58] and the objective of this methodology being to facilitate application, activity chains were obtained from MID rather than being artificially generated. The main and secondary activities are distinguished within the activity chains. The main activities are the main purpose of leaving home as indicated in the mobility survey. Each roundtrip starting and ending at home therefore has exactly one main activity. All remaining activities are considered secondary activities. This information is used later on when locating activities in Section 3.3.3 and when assigning the times and durations of activities in Section 3.3.4. During location choice, the difference between the main and secondary activities induces different amounts of driving and detour willingness. In addition to the consideration of main and secondary activities, the relative weightings of the reporting persons from MID has to be respected in the derivation of activity chains. MID, like other general mobility surveys, uses weightings to correct for biases introduced by the participant selection frame, as opposed to the composition of the general population [16]. These weightings were carried over to the transformed car-based mobility survey and subsequently propagated to weightings of the aggregated activity chains.  
Depending on the weighting factor of the obtained activity chains, sampling probabilities can be derived and exceptionally uncommon activity chains can explicitly be removed if desired for the respective application.  
Using the presented approach, 1737 unique activity chains were identified within MID. MID includes a dedicated trip type for the \"return from a previous activity\". Since the following activity type could not be deduced from this label, and due to its low share among all trip types (2.5%), all activity chains containing this type were removed. Furthermore, activity chains with less than five weighted occurrences were considered to be exceptionally rare and thus removed from the set of activity chains. A qualitative assessment of these rare activity chains showed that they were especially prone to implausibilities. These are, for example, the excessive repetition of activity types at home or work. fter all filtering steps, 173 unique activity chains with their respective probabilities remained.  
Once the activity chains were generated and filtered as described before, each car was iteratively assigned an activity chain for each day of the desired simulation period.  
The result of this step was that each car then possessed a sequence of activity types for the simulated period of time. In multi-day simulation scenarios, some cars--mostly owned by the non-working share of the population--are expected to not be driven daily. To reflect this sociodemographic influence on activity selection, the activity chains were split into four groups based on whether or not they contained work activities and whether or not they started at home in the morning. While other studies distinguish more than two clusters in order to represent all relevant mobility groups within a population [59], the division into working and non-working populations was chosen to simplify the approach. This equals the methodology of [PERSON] [44] in that respect.  
In order to model the difference between the working and non-working parts of the population, two additional hyperparameters were introduced into the model: \(p_{\text{drive\_every\_day}}\) and \(p_{\text{car\_driven}}\). First, it was decided whether a car was driven every day based on the probability \(p_{\text{drive\_every\_day}}\). If this was not the case, then the second step was to decide daily whether the car was used or not with a probability \(p_{\text{car\_driven}}\) and hence whether an activity chain was to be drawn for this day of the simulation.