## 6 Evaluation
### Case Description and Simulation Configuration
\begin{table}
\begin{tabular}{l l l l} \hline \hline
**Name** & **Values** & **Unit** & **Meaning** \\ \hline seed & [1,..., 10] & n/a & Simulation random generator seed \\ \(P_{c}\) & [\(\frac{1}{3}\) ] \(k\in[0,...,3]\) & n/a & Fraction of LoRa devices whose computation is hosted on the edge \\ \(P_{l}\) & [\(\frac{1}{3}\) ] \(k\in[0,...,3]\) & n/a & Fraction of thermostats whose computation is hosted on the local device \\ \(d_{ee}\) & \(10^{T}\) ] \(k\in[-1,0,1]\) & ms & Network delay in edge-to-edge communication \\ \(d_{ee}\) & [5, 25, 100] & ms & Network delay in cloud-to-cloud communication \\ \(d_{ee}\) & [10, 50, 300, 1000] & ms & Network delay in edge-to-cloud and cloud-to-edge communication \\ \(d_{a}\) & [50, 150, 500] & ms & Network access delay for smart thermostats \\ \(B\) & [cloud, edge] & n/a & Deployment position of the MQTT broker \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Free variables for the case. Figure 7: Function used in the case study to set the maximum allowed temperature setpoint based on the current estimation of the CAQI index (a metric of air pollution). variables in our experiments, summarized in Table 3. We also take into account the case in which two logically separate components are hosted on the same physical machine, in which case the data rate is considered virtually unlimited, thus \(\sfrac{s}{b}\simeq 0\), and consequently consider such delay as constant \(D=d_{l}=0.015\) ms. Logical devices are programmed to: (i) consider pollution data from all nodes within 2 hops; (ii) compute the local pollution value as the weighted mean of such information, using the inverse of the distance as weights; and (iii) use the value to set the maximum allowed temperature, if the appropriate actuator is available. Instead of directly relying on \(PM_{10}\) as metric, it computes the CAQI index [73], in such a way that future addition of further pollution metrics such as \(PM_{2.5}\) can be considered with no change to behavior. The relationship between the computed CAQI index and the desired temperature used in our experiments is shown in Figure 7.  
The program, excerpted in Figure 8, is entirely independent of the actual deployment of logical devices' components. We simulate the system evolution over four days (96 h). Device round frequency is set to 1/900 Hz. We perturb the system by reproducing the reduction in \(PM_{10}\) caused by a rainfall [74] starting from the northern side of the city after 25 h of simulation, covering the whole city at the 31 st simulated hour, and terminating at the 61 st hour. Figure 9 shows the system's evolution through snapshots of a simulation run. Our reference metrics are presented in Table 4. Temperature measures are used to verify that the system is operating nominally, regardless of the deployment configuration. Latency measures are intended as a performance proxy, showcasing that different deployment choices provide different tradeoffs. We also provide an operating cost estimation for the deployment. Our estimation is the following:  
* We estimate the pricing for operating the MQTT broker on the cloud by referring to the prices of a prominent operator available at the time of writing ([[https://archive.is/9g2](https://archive.is/9g2) tk]([https://archive.is/9g2](https://archive.is/9g2) tk)). * We assume the broker located on the edge to be self-hosted, thus with a negligible upkeep cost. * We consider the smallest cloud server instances available from one of the major players ([[https://archive.is/9](https://archive.is/9) fg0e]([https://archive.is/9](https://archive.is/9) fg0e)). We estimate that each such instance has enough memory to comfortably host about a hundred pulverized smart thermostats. * For any cloud hosting service, we pick the pricing for the infrastructure located geographically closest to Leuven (in our case, located in Frankfurt). * We include the electricity pricing to estimate the operating cost for smart thermostats (Arguably, this cost would be charged to the end users, and thus not impact the actual operating cost directly.