## 2 Methodology
### Synthesis Framework
The total number of workers and visitors for each facility was assigned by multiplying the total floorspace of each building with the productivity of a floorspace. It is important to note that open-air facilities were defined to have unlimited visitor capacity, and not to have residents and employees. Lastly, the results of the assignment operation for the residents, visitors, and facility capacities are visualized below by utilizing ArcGIS Pro. Figure 5 demonstrates the geoposition of all assigned locations in the study area based on home, work, educational, and secondary activity categories (free-time, shopping, errands). Figure 6 quantifies the number of residents in each building and the capacities of the work and educational facilities, while Figure 7 visualizes the number of visitors for the secondary activity locations (free-time, shopping, errands) in the study area. Step D1.2 defines work and educational zones for each person in the synthetic population by utilizing the OD proportions outputted in the D1.1 operation, as in the Sao Paulo scenario [19]. For each origin home zone \(o\) and destination primary zone \(d\), we used multinomial distribution to estimate the quantity of trips \(f_{od}\) (and assigned citizens to these trips) until the last destination \(D\), based on the OD proportions \(p_{od}\) and the number of people traveling from the origin zone \(n_{o}\):  
\[(f_{o,1},\ldots,\ f_{o,D})\ \sim\ Multinomial\left(n_{o};p_{o,1},\ldots,\ p_{o,D}\right) \tag{5}\]In step P2, residential and primary activity locations of the citizens are assigned by utilizing two different algorithms, as demonstrated in Figure 8. First, the framework assigns the citizens by using algorithm 1 to the residential buildings located in the zone where they live according to CD-2016 data. Then, once the home location of every person is defined, the framework assigns the primary activity locations (i.e., work and educational) of the citizens by applying algorithm 1 if the home and primary activity location are in the same zone, and when the home location and primary activity are in different zones, then algorithm 2 is applied. The assignment process is conducted in order, where each arrangement corresponds to a portion of the population and a subset of facilities to be assigned. For instance, a citizen working in the retail sector based on the CD-2016 is to be considered for all possible work locations classified as either events, commercial, or multipurpose in the RCDB. For another example, students within the age group 8-14  
Figure 5: Geoposition of all locations. Figure 3:0 The number residents in houses (**left** figure) and the capacity of work and educational facilities (**middle** and **right** figures, respectively). have their educational locations filtered to schools offering the grades of a primary school. However, citizens over 29 years old were additionally placed in this category, because parents are likely to escort children to primary schools. Algorithm 1 runs several times, once for each zone and selecting only the facilities located inside the zone. Initially, the algorithm checks if any relevant facility \(j\) is present in the zone with the attributes matching with a specific portion of the population (e.g., age group 8-14 for primary schools), and if not, random locations with unlimited occupancy \(\mathbf{O}_{j}\) in the zone are generated. The occupancy \(\mathbf{O}_{j}\) of a facility is defined according to the number of inhabitants (in the case of residential assignment), work places (in the case of worker assignment), and study places (in the case of student assignment). In the case of residential locations, the assigned facility is simply defined by the one with the maximum available occupancy, and then once a person \(i\) is assigned to a building \(j\), then one unit of occupancy, i.e., \(F_{i}=j\), one unit of occupancy is dropped from \(\mathbf{O}_{j}\). In the case of the assignment of primary locations, for every person \(i\), the distance between home and each facility \(d_{j}\) is calculated.