Agent-Based Modeling of the Hajj Rituals with the Possible Spread of COVID-19

With the coronavirus (COVID-19) pandemic continuing to spread around the globe, there is an unprecedented need to develop different approaches to containing the pandemic from spreading further. One particular case of importance is mass-gathering events. Mass-gathering events have been shown to exhibit the possibility to be superspreader events; as such, the adoption of effective control strategies by policymakers is essential to curb the spread of the pandemic. This paper deals with modeling the possible spread of COVID-19 in the Hajj, the world’s largest religious gathering. We present an agent-based model (ABM) for two rituals of the Hajj: Tawaf and Ramy al-Jamarat. The model aims to investigate the effect of two control measures: buffers and face masks. We couple these control measures with a third control measure that can be adopted by policymakers, which is limiting the capacity of each ritual. Our findings show the impact of each control measure on the curbing of the spread of COVID-19 under the different crowd dynamics induced by the constraints of each ritual.


Introduction
The Hajj is considered to be one of the largest mass gatherings in the world. It is an annual Islamic pilgrimage to Mecca, Saudi Arabia, which has drawn an average of two million pilgrims per year. It consists of a series of rituals that must be performed within certain spatial and temporal constraints. The spatial constraints are dictated by the geometry of the areas where these rituals are contained. Moreover, both the temporal and spatial constraints are dictated by the proceedings of each ritual.
Due to the unique dynamics of the Hajj and a push by policymakers to provide a safe pilgrimage, extensive research has been conducted towards crowd management, control and simulation. Technological advancements such as computer systems, sensors, mobile applications, wireless systems and immersive technologies have been proposed as solutions for safe crowd management and control [1][2][3]. Moreover, crowd simulations have also been a popular approach to investigate different control strategies for crowd management, crowd evacuation and disease outbreaks [4][5][6][7][8]. Agent-based modeling has emerged as a tool to model the progression and effects of COVID-19 with regard to different aspects, such as health, the economy and facilities [9][10][11][12]. The Saudi Arabian health authorities have a history of containing possible communicable disease that could spread among the pilgrims. Every year they are faced with a new set of public health challenges with the emergence and reemergence of infectious diseases. The Ebola outbreak, the cholera epidemic in Yemen and the Zika virus are examples of such recent challenges [13][14][15]. This requires careful planning among several committees and subcommittees in order to avoid any public health threats to the host community and the international community [16]. In the case of the Ebola outbreak, entry restrictions on countries affected by the outbreak were implemented. Vaccination requirements for entry have been introduced by the Ministry of Health in order to contain outbreaks such as the Yellow Fever for pilgrims from certain countries. Advance infrastructure planning, disease monitoring and the surveillance of global diseases, domestic and international cooperation with agencies, and screening at entry points are examples of other measures aimed at protecting the pilgrims at the Hajj [13,17].
With the current coronavirus (COVID- 19) pandemic, there are unprecedented challenges facing policymakers when adopting control strategies that would be effective in containing an outbreak [18][19][20]. Epidemiological models have played an important role in providing a quantitative evaluation method for the control strategies to be adopted, and in modelling the progression of the disease. Prediction methods such as compartmental models or machine learning-based models have been proposed to predict the infection of COVID-19 in Saudi Arabia [21][22][23]. Since the start of the pandemic, the country has taken precautionary measures such as blocking air travel, monitoring entry points, restricting the Hajj ritual, introducing digital health applications, imposing curfews and limitations on social gatherings, and mandating face masks [24,25].
Several superspreader events have been reported as the source of COVID-19 clusters emerging in different parts of the world. These events are characterized by an abnormal number of secondary infections due to one contagious person. Several societal religious superspreader religious events were reported in South Korea, Germany and the USA [26]. The Hajj pilgrimage may provide the potential to be a superspreader event [27]; as such, policymakers need to be careful with their approach towards this event. The 2020 Hajj season limited the number of pilgrims, mandated face masks, enforced social distancing, monitored pilgrims for symptoms, and placed restrictions on some rituals; for example, pilgrims were not allowed to touch the Kaaba in an attempt to curb the possibility of such an event and provide protection to the pilgrims [19,28].
In this work, we present an agent-based model to study the effect of different control measures on the progression of infection during the Hajj pilgrimage. We focus our work on two of the rituals of Hajj: Tawaf and Ramy al-Jamarat. These two rituals provide unique spatial constraints and crowd dynamics. We also incorporate the crowd mobility behaviors exhibited during these rituals. We look at the case of an infection event and study the effect of the control measures in curbing the progression of infection. The control measures are buffers, which represent symptom screening at entry points, face mask wearing and ritual capacity constraints. In order to achieve the effective surveillance and monitoring of the spread of COVID-19 during the Hajj ritual, it is important for policymakers to carry out a quantitative evaluation of the control measures.

Methods
In this section, we explain the proposed agent-based model for the simulation of the transmission of COVID-19 in the Hajj. Two rituals of the Hajj-Tawaf and Ramy al-Jamarat-are selected and modeled. These two rituals represent instances of mass crowd gatherings, and each offers unique crowd dynamics. In Tawaf, the pilgrims go around the Kaaba seven times in a counterclockwise direction. In Ramy al-Jamarat, the pilgrims attempt to throw seven pebbles at each of three stone structures known as Jamarat. The pilgrims move towards each Jamarat and congregate around it while each pilgrim tries to move closer to be able to throw the pebble. This is then repeated for the other two Jamarat. The developed models take into account the unique spatial constraints of each ritual, as well as their crowd mobility behaviors. All of the models were constructed and simulated in NetLogo [29].

Environment
Two environments were designed to replicate the spatial structure of the Tawaf and Ramy al-Jamarat rituals. Each environment was modeled as a grid containing a discrete number of squares called "patches". Furthermore, the patches were divided into traversable patches, i.e., patches that an agent can move to, and untraversable patches, i.e., patches that are inaccessible for an agent, such as walls. The layout of the Tawaf environment is shown in Figure 1 and the Ramy al-Jamarat model is shown in Figure 2. Capturing the spatial constraints of each ritual is important in affecting the decision of agents and the crowd's behavior, as each individual agent in the simulation makes a decision so as to move towards their own goal. well as their crowd mobility behaviors. All of the models were constructed and simulated in NetLogo [29].

Environment
Two environments were designed to replicate the spatial structure of the Tawaf and Ramy al-Jamarat rituals. Each environment was modeled as a grid containing a discrete number of squares called "patches". Furthermore, the patches were divided into traversable patches, i.e., patches that an agent can move to, and untraversable patches, i.e., patches that are inaccessible for an agent, such as walls. The layout of the Tawaf environment is shown in Figure 1 and the Ramy al-Jamarat model is shown in Figure 2. Capturing the spatial constraints of each ritual is important in affecting the decision of agents and the crowd's behavior, as each individual agent in the simulation makes a decision so as to move towards their own goal.   well as their crowd mobility behaviors. All of the models were constructed and simulated in NetLogo [29].

Environment
Two environments were designed to replicate the spatial structure of the Tawaf and Ramy al-Jamarat rituals. Each environment was modeled as a grid containing a discrete number of squares called "patches". Furthermore, the patches were divided into traversable patches, i.e., patches that an agent can move to, and untraversable patches, i.e., patches that are inaccessible for an agent, such as walls. The layout of the Tawaf environment is shown in Figure 1 and the Ramy al-Jamarat model is shown in Figure 2. Capturing the spatial constraints of each ritual is important in affecting the decision of agents and the crowd's behavior, as each individual agent in the simulation makes a decision so as to move towards their own goal.

Disease Dynamics
Each agent was categorized by the status of the disease and its symptoms. An agent was classified as either susceptible, infectious and asymptomatic, or infectious and symptomatic, with a probability associated with each classification. A random number was drawn from a uniform distribution to classify each agent. The disease spreads from the infectious population to the susceptible population upon contact. Each infectious agent has a probability I 0 to infect one of their direct susceptible neighbors. Hence, we modeled the spread of the disease as contact between direct neighbors, i.e., agents on adjacent patches in the simulation. We also assumed that once a susceptible agent had been infected, then that agent could begin infecting others with no latent period. We also assumed that the infectiousness was time independent due to the short time it takes to perform the Tawaf and Ramy al-Jamarat when compared to the period of communicability of COVID-19. Instead, the infectiousness in our models depended on the number of infectious contacts a susceptible agent had, and on whether an agent was wearing a face mask, which reduces the infectiousness by a certain factor. This means that the infectiousness of the disease does not change with prolonged contact but instead depends on the number of contacts, and it was calculated at every time instance that contact with an infectious agent was made. The result was defined as the effective infectiousness: where I 0 , N c and η mask represent the infectiousness of the disease, the total number of infectious contacts and the face mask efficiency, respectively.

Crowd Mobility Behavior
Different crowd mobility behaviors exist for each ritual. These behaviors are induced by the spatial constraints and the acts required to perform the rituals. By modeling the spatial structure of each ritual, we aimed to induce these crowd mobility behaviors in the interaction of the agents. The agents interact with each other according to the decisions they make when deciding their next movement. This will directly affect the movement of all of the neighboring agents and induce the crowd mobility behavior. For stochasticity, we modeled randomness in the decisions of the agents. The agents were assigned random locations at the beginning, and their movements were selected randomly when several valid movements were available. We also defined a set of behavioral rules for each agent so as to adapt their movements and induce more natural behaviors: • Agents located at a far distance from their goal move slightly faster. • Agents always pick the next patch to become closer to the goal while avoiding collisions with the environment and other agents. • Agents adapt to crowding by moving slightly outwards in order to allow some space for flow from within the crowd. This was necessary in order to avoid the agents inside the crowd becoming stuck.

•
In Ramy al-Jamarat, the agents adapt their movement by always picking the shortest exit based on their current position.
In Tawaf, the agents started at some random location outside the wall of the mataf and began moving towards the nearest gate in order to enter the mataf area. Once inside the mataf, the agents began moving in a spiral counterclockwise pattern towards the center of the mataf, joining the crowd already present. Once an agent had completed seven rotations, they were removed from the simulation at their current position. This was carried out in order to avoid unrealistic congestion caused by the resolution of the environment, as agents were not allowed to overlap; hence, those near the center cannot move out. However, the crowd dynamics and behaviors when both entering and performing the ritual were still captured. The simulated behavior was captured in Figure 3.  In Ramy al-Jamarat, the agents start at a random location before the first pillar. The crowd behavior is such that the agents move towards each pillar in sequence and congregate around it as each agent aims to move closer, so as to be in range of throwing a pebble. It takes an agent four simulation steps, or ticks, to successfully throw a single pebble. Once an agent has thrown seven pebbles, they move on to the next pillar until all three pillars have been visited. The agent only attempts to throw a pebble when they are within a defined range of the pillar, and is always successful; here, we defined this range as a radius of four squares. The agents that have completed the ritual move towards the exit and are then removed from the simulation at their current position. This behavior is captured in Figure 4.  In Ramy al-Jamarat, the agents start at a random location before the first pillar. The crowd behavior is such that the agents move towards each pillar in sequence and congregate around it as each agent aims to move closer, so as to be in range of throwing a pebble. It takes an agent four simulation steps, or ticks, to successfully throw a single pebble. Once an agent has thrown seven pebbles, they move on to the next pillar until all three pillars have been visited. The agent only attempts to throw a pebble when they are within a defined range of the pillar, and is always successful; here, we defined this range as a radius of four squares. The agents that have completed the ritual move towards the exit and are then removed from the simulation at their current position. This behavior is captured in Figure 4.  In Ramy al-Jamarat, the agents start at a random location before the first pillar. The crowd behavior is such that the agents move towards each pillar in sequence and congregate around it as each agent aims to move closer, so as to be in range of throwing a pebble. It takes an agent four simulation steps, or ticks, to successfully throw a single pebble. Once an agent has thrown seven pebbles, they move on to the next pillar until all three pillars have been visited. The agent only attempts to throw a pebble when they are within a defined range of the pillar, and is always successful; here, we defined this range as a radius of four squares. The agents that have completed the ritual move towards the exit and are then removed from the simulation at their current position. This behavior is captured in Figure 4.  . Crowd mobility during the Ramy al-Jamarat ritual. The progression of the crowd movement during the simulation is shown by the arrows. An agent starts at the left-most area and moves towards the first pillar. The agent then moves towards the next pillar and then moves towards the final, third, pillar. At each pillar, the agent navigates into the crowd in order to move towards the pillar and throw the pebbles. Finally, the agent finishes all three pillars and leaves the area at the rightmost exits. Once an agent reaches the exit, they are removed from the simulation.

Control Measures
The evaluation of the control measures assists organizers with the prediction and surveillance of the virus. In both models, we studied the effect of two commonly adopted control measures in preventing the spread of COVID-19: face masks and buffers. Buffers can represent checkpoints for symptom screening or the proof of a negative COVID-19 test result. These two control measures were selected as they have been more commonly adopted by countries, with the issuance of mask mandates and testing becoming more available for the general public. Moreover, recent analysis has proven that face masks are effective in curbing the spread of the disease in different settings and populations [30][31][32]. In our analysis, we assumed that all of the agents are wearing face masks and will be stopped at the screening checkpoint before entry into the main ritual area.

Evaluation Metrics
We inferred the efficacy of the control measures, both their individual and combined efficacy, by evaluating the prevalence of the disease in the population. We followed the definition of the prevalence of the disease as the ratio of the total number of infected agents to the total population over the course of each simulation. We also defined an additional evaluation metric, the infection reproduction number, as the expected number of infected agents created by an active infected agent. We also defined an active infected agent as an agent that had previously infected a susceptible agent. This metric is formalized in Equation (2): where R is the infected reproduction number, N H I is the number of susceptible agents that have been infected, and N I A is the number of active infected agents.

Results and Discussion
The constructed agent-based model of the Hajj rituals, namely Tawaf and Ramy al-Jamarat, was used to evaluate the effect of the control measures on the prevalence and infected reproduction number of the virus during these rituals. The disease dynamics were set according to the parameters given in Table 1 for all of the experiments. Each simulation was run three times, and the evaluation metrics defined in the Methodology were collected at the end of each run. The average of these metrics across all of the simulations was taken for each experiment. We assumed that the agents were stopped by the buffers and were wearing facemasks. The experiments were run on a PC with Intel ® Core™ i7-9700 CPU @ 3.00 GHz × 8, GeForce RTX 2070 SUPER, 64 GB of RAM, and the Windows 10 operating system.

Effect of the Control Measures on the Prevalence and the Infected Reproduction Number
We first began by studying the effect of the control measures on the prevalence and the infected reproduction number of the disease in the rituals. These experiments were initialized with one infected agent among a healthy starting population of 3000 agents. The new agents were introduced at regular intervals until the maximum population of 10,000 agents was reached, after which no new agents were introduced. This interval was set to each tick. Each new agent had a 3% probability of being initially infected before entering the ritual. In Ramy al-Jamarat, each pebble required two ticks to be thrown. The efficacy of the two control measures, buffers and face masks, was varied. Figures 5 and 6 show the effect of the control measures in the Tawaf ritual. With a face mask efficacy less than 70%, the prevalence of the disease remains above 80% regardless of the buffer efficacy. However, with 90% face mask efficacy, we found the prevalence to decline to 21%. The prevalence continues to decrease with increased buffer efficacy. With 100% buffer efficacy, the prevalence was as low as 5.29%. This shows that for the Tawaf ritual, the primary control measure to reduce the COVID-19 prevalence is a good face mask with an efficacy of 90% and above. With this control measure in place, increasing the buffer efficacy results in the further reduction of the total infection. The effect of the control measures was less significant on the infected reproduction number. Varying the buffer efficacy had no significant effect on driving down the infected reproduction number. Similarly, a face mask efficacy less than 90% had no significant effect on reducing the infected reproduction number. However, having a face mask efficacy greater than 90% resulted in a lower infected reproduction number. Increasing the face mask efficacy above 90% resulted in a significant effect in controlling the infection.

Tawaf
The results of these experiments show that a high-efficacy mask (>90% efficacy) is required to curb the spread of infection during the Tawaf. Low-efficacy masks had little effect. Moreover, the face mask was a more efficient control measure than the buffers. The results also show that effective buffers require an effective facemask, as shown in Figure 5. set to each tick. Each new agent had a 3% probability of being initially infected before entering the ritual. In Ramy al-Jamarat, each pebble required two ticks to be thrown. The efficacy of the two control measures, buffers and face masks, was varied. Figures 5 and 6 show the effect of the control measures in the Tawaf ritual. With a face mask efficacy less than 70%, the prevalence of the disease remains above 80% regardless of the buffer efficacy. However, with 90% face mask efficacy, we found the prevalence to decline to 21%. The prevalence continues to decrease with increased buffer efficacy. With 100% buffer efficacy, the prevalence was as low as 5.29%. This shows that for the Tawaf ritual, the primary control measure to reduce the COVID-19 prevalence is a good face mask with an efficacy of 90% and above. With this control measure in place, increasing the buffer efficacy results in the further reduction of the total infection. The effect of the control measures was less significant on the infected reproduction number. Varying the buffer efficacy had no significant effect on driving down the infected reproduction number. Similarly, a face mask efficacy less than 90% had no significant effect on reducing the infected reproduction number. However, having a face mask efficacy greater than 90% resulted in a lower infected reproduction number. Increasing the face mask efficacy above 90% resulted in a significant effect in controlling the infection.

Tawaf
The results of these experiments show that a high-efficacy mask (>90% efficacy) is required to curb the spread of infection during the Tawaf. Low-efficacy masks had little effect. Moreover, the face mask was a more efficient control measure than the buffers. The results also show that effective buffers require an effective facemask, as shown in Figure 5.   Figures 7 and 8 show the effect of the control measures in the Ramy al-Jamarat ritual. The buffer efficacy plays a more crucial role in reducing the prevalence, along with the face mask efficacy, as compared to the Tawaf ritual. With 50% face mask efficacy and no buffers, we were able to lower the prevalence to less than 50%. By increasing the buffer efficacy, we were able to further reduce the prevalence to below 18%. With 90% face mask efficacy, the prevalence of the disease persisted to be below 2%.  The buffer efficacy plays a more crucial role in reducing the prevalence, along with the face mask efficacy, as compared to the Tawaf ritual. With 50% face mask efficacy and no buffers, we were able to lower the prevalence to less than 50%. By increasing the buffer efficacy, we were able to further reduce the prevalence to below 18%. With 90% face mask efficacy, the prevalence of the disease persisted to be below 2%.  Figures 7 and 8 show the effect of the control measures in the Ramy al-Jamarat ritual. The buffer efficacy plays a more crucial role in reducing the prevalence, along with the face mask efficacy, as compared to the Tawaf ritual. With 50% face mask efficacy and no buffers, we were able to lower the prevalence to less than 50%. By increasing the buffer efficacy, we were able to further reduce the prevalence to below 18%. With 90% face mask efficacy, the prevalence of the disease persisted to be below 2%.  Like the previous result, this shows that a face mask with high efficacy is an efficient control measure to curb the infection. However, unlike the Tawaf ritual, face masks with lower efficacy have a more significant effect on curbing the infection. We attribute this observation to the distinct crowd dynamics that are present in each ritual. Tawaf is a more congregated setting, while ramy represents a more dispersed movement, hence the number of infectious contacts is less. Similar to what we observed for the Tawaf ritual, the effect of the control measures on the infected reproduction number was less significant, with the buffers having very little effect.

Effect of Coupling Crowd Control with Preventative Control Measures
Along with control measures such as face masks and entry buffers, crowd control measures have also been a measure widely adopted by policymakers to curb the spread of COVID-19 within places of mass gathering. To help assist the policymakers in inferring the effect of crowd control measures on the spread of the virus, we studied the effect of limiting the total capacity used on the prevalence and infected reproduction number of the disease. In this sense, we introduced crowd control by limiting the total number of agents performing the ritual at the same time. This means that once the maximum allowed capacity of agents performing the ritual simultaneously is reached, no new agent can be introduced until an existing agent has left the ritual. For these experiments, we set the buffer efficacy to 100% and instead focused on varying the face mask efficacy. This was performed because the face mask was found to be the primary control measure in Section 3.1.1 and Section 3.1.2. Figures 9 and 10 show the effect of implementing ritual capacity constraints coupled with control measures on the spread of the disease in Tawaf. We can see that this coupling is successful in curbing the spread of infection because the infected reproduction number and the disease prevalence are reduced. Moreover, the addition of the ritual capacity restrictions resulted in better control of the spread of the disease than in the previous case of no restrictions. We also noticed the emergence of a threshold between 1% and 5% ritual capacity after which face masks with lower efficacies have a larger effect on curbing the Like the previous result, this shows that a face mask with high efficacy is an efficient control measure to curb the infection. However, unlike the Tawaf ritual, face masks with lower efficacy have a more significant effect on curbing the infection. We attribute this observation to the distinct crowd dynamics that are present in each ritual. Tawaf is a more congregated setting, while ramy represents a more dispersed movement, hence the number of infectious contacts is less. Similar to what we observed for the Tawaf ritual, the effect of the control measures on the infected reproduction number was less significant, with the buffers having very little effect.

Effect of Coupling Crowd Control with Preventative Control Measures
Along with control measures such as face masks and entry buffers, crowd control measures have also been a measure widely adopted by policymakers to curb the spread of COVID-19 within places of mass gathering. To help assist the policymakers in inferring the effect of crowd control measures on the spread of the virus, we studied the effect of limiting the total capacity used on the prevalence and infected reproduction number of the disease. In this sense, we introduced crowd control by limiting the total number of agents performing the ritual at the same time. This means that once the maximum allowed capacity of agents performing the ritual simultaneously is reached, no new agent can be introduced until an existing agent has left the ritual. For these experiments, we set the buffer efficacy to 100% and instead focused on varying the face mask efficacy. This was performed because the face mask was found to be the primary control measure in Sections 3.1.1 and 3.1.2. Figures 9 and 10 show the effect of implementing ritual capacity constraints coupled with control measures on the spread of the disease in Tawaf. We can see that this coupling is successful in curbing the spread of infection because the infected reproduction number and the disease prevalence are reduced. Moreover, the addition of the ritual capacity restrictions resulted in better control of the spread of the disease than in the previous case of no restrictions. We also noticed the emergence of a threshold between 1% and 5% ritual capacity after which face masks with lower efficacies have a larger effect on curbing the spread of the disease. This threshold can be pushed further by increasing the face mask efficacy and hence allowing a larger crowd capacity. This shows the relationship and dependence of the ritual capacity on the efficacy of the control measure used. However, similar to what we have seen in the previous section, the effect on the infected reproduction number is less significant.

Tawaf
Sustainability 2021, 13, x FOR PEER REVIEW 10 of 14 spread of the disease. This threshold can be pushed further by increasing the face mask efficacy and hence allowing a larger crowd capacity. This shows the relationship and dependence of the ritual capacity on the efficacy of the control measure used. However, similar to what we have seen in the previous section, the effect on the infected reproduction number is less significant.

Ramy al-Jamarat
Similar to the trends that we have seen for the Tawaf ritual, we found once again that limiting the maximum allowable capacity is successful in driving down the spread of in- spread of the disease. This threshold can be pushed further by increasing the face mask efficacy and hence allowing a larger crowd capacity. This shows the relationship and dependence of the ritual capacity on the efficacy of the control measure used. However, similar to what we have seen in the previous section, the effect on the infected reproduction number is less significant.

Ramy al-Jamarat
Similar to the trends that we have seen for the Tawaf ritual, we found once again that limiting the maximum allowable capacity is successful in driving down the spread of in-

Ramy al-Jamarat
Similar to the trends that we have seen for the Tawaf ritual, we found once again that limiting the maximum allowable capacity is successful in driving down the spread of infection, as shown in Figures 11 and 12. In this case, we noticed the emergence of the threshold between 7% and 12% crowd capacity. The larger threshold can be attributed to the more spread-out crowd mobility dynamics of the ritual. Increasing the capacity beyond the threshold does not result in a significant change in the spread of the disease. However, increasing the control measure efficacy allows a larger ritual capacity for the same spread of infection. fection, as shown in Figures 11 and 12. In this case, we noticed the emergence of the threshold between 7% and 12% crowd capacity. The larger threshold can be attributed to the more spread-out crowd mobility dynamics of the ritual. Increasing the capacity beyond the threshold does not result in a significant change in the spread of the disease. However, increasing the control measure efficacy allows a larger ritual capacity for the same spread of infection.   fection, as shown in Figures 11 and 12. In this case, we noticed the emergence of the threshold between 7% and 12% crowd capacity. The larger threshold can be attributed to the more spread-out crowd mobility dynamics of the ritual. Increasing the capacity beyond the threshold does not result in a significant change in the spread of the disease. However, increasing the control measure efficacy allows a larger ritual capacity for the same spread of infection.

Conclusions
We introduced an agent-based model to model and quantitatively evaluate the effect of two control measures, face masks and entry buffers, on the progress of an infection event during the Hajj ritual. We incorporated the different spatial constraints and crowd mobility behaviors present for each ritual during the simulation. We also coupled the control measures with limiting the ritual capacity. The simulation results showed that for both rituals, face masks would be the primary control measure to curb the spread of infection. This control measure is generally easy to implement but provides a significant impact on curbing an infection event. The results also indicate that a high face mask efficacy is necessary to increase the ritual capacity without drastically increasing the prevalence of the disease. Moreover, we showed the dependence of increasing the ritual capacity on having good, effective control measures. Buffers, however, were found to be less effective and, more so, their effect is unnoticed without the presence of a high efficacy face mask. The control measures were more effective in Ramy al-Jamarat compared to the Tawaf ritual based on the experiments. We attribute this effect to the more spread-out crowd dynamics in the Ramy al-Jamarat ritual, which result in less inter-agent contact, hence reducing the effective spread of the disease. Therefore, the main challenge for policymakers would be to curb the spread of infection during the Tawaf ritual, which represents a more congregated setting. Based on this analysis, we would recommend that policymakers emphasize distributing high-efficacy facemasks, and that they place high restrictions on the ritual capacity. The assumptions made on the disease dynamics, infection mechanism and crowd behaviors place limitations on the model; hence, these results should be interpreted as a qualitative baseline for policymakers when implementing effective control measures.