## 3 Results
### Adaptive Learning Integration with ABMS
\[R=\frac{1}{\text{social distancing measure}}-\text{current density of the location} \tag{7}\]  
```
Input:\(s\), the current location (state) \(\epsilon\in(0,1]\), the exploration probability Output:\(a\), the next place to visit (action) \(A\leftarrow\) available sites to visit while being in \(s\); \(r\gets Uniform(0,1)\); if\(r<1-\epsilon\)then \(top\leftarrow-\infty\); \(ties\leftarrow\{\}\); foreach\(a\in A\)do if\(Q(s,a)>top\)then \(top\gets Q(s,a)\); \(ties\leftarrow\{a\}\); elseif\(Q(s,a)=top\)then \(ties\leftarrow\)\(ties\cup\{a\}\); \(a\leftarrow\) random action from \(ties\); else \(a\leftarrow\) random action from \(A\); return a;
```  
**Algorithm 4**\(\epsilon\)-greedy action selection  
```
Input:\(s\), the current location (state) \(\epsilon\in(0,1]\), the exploration probability Output:\(a\), the next place to visit (action) \(A\leftarrow\) available sites to visit while being in \(s\); \(r\gets Uniform(0,1)\); if\(r<1-\epsilon\)then \(top\leftarrow-\infty\); \(ties\leftarrow\{\}\); foreach\(a\in A\)do if\(Q(s,a)>top\)then \(top\gets Q(s,a)\); \(ties\leftarrow\{a\}\); elseif\(Q(s,a)=top\)then \(ties\leftarrow\)\(ties\cup\{a\}\); \(a\leftarrow\) random action from \(ties\); else Considering the four preceding ingredients, the learning scheme can be summarized in Algorithm 5. Essentially, adaptation only happens when the agent faces site selection circumstances. It is crucial to clarify that the convergence of the algorithm greatly depends on the parameter configuration, as careful attention is required to balance the exploration-exploitation dilemma [16]. For that purpose, a three-factor factorial design of experiments is applied to analyze each parameter's effects. Despite everything, results are expected to show different outcomes, good or bad, under each scenario. Anyhow, the intention was not to reveal pleasing results in all examined situations; instead, the idea is to identify the key differences under various settings. ```
Input:\(\alpha\in(0,1]\), the learning rate \(\gamma\in(0,1]\), the discount rate \(e\in(0,1]\), the exploration probability \(s\leftarrow\) Initial location; foreachdecision situation the agent facesdo \(s\leftarrow\) Agent's current location;  Choose a place \(a\) according to the \(e\)-greedy procedure;  Move to site \(a\), observe reward signal \(r\); \(Q(s,a)\gets Q(s,a)+\alpha[r+\gamma\max_{b}Q(a,b)-Q(s,a)]\); \(s\gets a\);
```

**Algorithm 5**Q-learning scheme for crowding reduction

In order to assess the influence of the implemented RL-based adaptive features, a base scenario is defined. The selected reference settings render a population of 10,000 students and 200 staffers and fix both the infectious radius and social distancing measure to 2 m. Additionally, we use a uniform random procedure to select facilities (similar to an \(e=1\) setup). Therefore, the picked parameter values are the same as those reported in the default value column in Table 4. However, remember that learning parameters \(\alpha\), \(\gamma\), and \(e\) have no effect at all in the course of the earlier described scenario. For descriptive purposes, mean on-campus densities for ten repetitions are shown in Figure 5.

Figure 5 reveals recurrent patterns of density peaks over the \(0.5\)\(\frac{people}{m^{2}}\) threshold, which indicates that the current crowding dynamics do not comply with recommended social practices. However, a more in-depth analysis is required to identify the temporal fragment that poses the greatest threat to the community. Next, some descriptive statistics for the density output are reported in Table 6.

Figure 5: Base mean densities on campus. Table 6 shows that the mean density on campus is around 0.10 people per square meter, meaning that agents are 10 m apart on average. Still, the median value is utterly different from the aforesaid measure, suggesting the presence of outliers. Yet, anomaly detection techniques are not applicable here as the outliers are of special interest in the analysis.