# Fog vs. Cloud Computing: Should I Stay or Should I Go? +
## 4 Analyzing Test Cases
### Simulating Other Scenarios  
As we have seen with our study of fog-prone and cloud-prone scenarios in the previous subsections, another application for our model is simulating the decision process for different ranges of values. This is useful to help us visualize how changes in technology may affect the decision to filter  
Figure 12: Graphs of the linear equations for each dataset and benchmark using energy consumption as the cost: Raspberry Pi 3.  
values in the device instead of sending them to be processed in the cloud. It also allows us to analyze how far we can change \(s\) and \(t\) and still keep the same decisions. The value of \(s\) is related to factors such as the network protocol being used (e.g., TCP, UDP); the implementation of network processes (e.g., routing); and the communication technology employed by the device (e.g., Wi-Fi, Bluetooth, Bluetooth Low Energy, LTE, Zigbee, WiMax). Moreover, it may include costs related to information security like authentication and data confidentiality. Therefore, improving the performance of any of these elements would decrease the value of \(s\) and lead us to change the decision from processing values in the fog to sending them to be processed in the cloud. At the same time, \(t\) is related to factors such as the quality of the filtering procedure's code and the technology of the processing unity used by the device. While we do not expect the performance of these elements to decrease with time, it is possible that \(t\) may increase as progressively more limited devices are employed or more robust features are added to the procedures being executed, which would also lead to processing data in the cloud being more profitable than doing so in the fog. In our simulations, we use the estimated \(f\) values for the fog-prone cases of the Synthetic dataset. The upper values for \(t\) are approximations of the result of Equation (6), and the \(s\) values are numbers close to the 7.3 ms, when the cost type is execution time, and 1.022 mJ, when the cost type is energy consumption. We calculate the slope of the lines obtained with these coefficients to observe how changing them affects our results. In all figures in this subsection, the dashed area represents the space where the values used in Sections 4.2 and 4.3 are located. The green cells (below the continuous line) are the ones where the slope is less than or equal to \(-1\), that is, the cases where fog computing is more profitable. The blue cells (above the continuous line) are the cases where cloud computing has the lower cost. Figure 12(a) depicts the simulation results for MinMax \([-15,15]\). In this case, we need to either increase \(t\) or decrease \(s\) by 5.1\(\times\) to reach a situation where fog computing no longer has the lowest cost. Figure 12(b) shows the simulation results for MinMax \([-5,5]\), for which we need to increase \(t\) or decrease \(s\) by only 1.9\(\times\) to change our decision. This is due to this case having a higher \(f\) than the previous one, which brings its initial slope already close to \(-1\). Figure 12(c) illustrates the simulation results for Outlier 16, and an increase in \(t\) or decrease in \(s\) of 9.8\(\times\) is necessary in this instance to make cloud computing the more profitable choice, as the initial slope is far from \(-1\) due to a very low value of \(f\). Figure 12(d) has the simulation results for Outlier 256. In this test, we need to increase \(t\) or decrease \(s\) by 2.8\(\times\) to change our decision. Although this case also presents a very low \(f\) value, this is compensated by a \(t\) value that is much closer to \(s\) than the other cases, explaining why its initial slope is much closer to \(-1\) than Outlier 16. The energy consumption values used in this analysis are the ones obtained for the NodeMCU device. Figure 13(a) has the MinMax \([-15,15]\) simulation results, for which there is a need to either increase \(t\) or decrease \(s\) by 20.6\(\times\) for cloud computing to become the most profitable choice.