# Parallel Agent-Based Framework for Analyzing Urban Agricultural Supply Chains
## 4 Agent-Based Framework for Analyzing Urban Agricultural Supply Chains
### Risk Submodel  
We compute the risk perceived by farmers when evaluating the crops to be cultivated as follows:  
\[Risk=Threat*Vulnerability. \tag{1}\]  
This risk is directly proportional to the threat and vulnerability. The threat is the level of danger associated with the occurrence of a potentially disastrous event. For the purposes of the simulation, the possible values of different threats (heatwaves, droughts, frosts, and pests) are classified into three levels: none (0), low (1), medium (2), and high (3). * FrostsTo determine the threat level of frosts for each month of the year, we compute the probability of at least one frost during the month, along with the probability that the minimum temperature of a frost falls within a specific range (from below \(-7\) degC to 0 degC). These values can be observed in Figures 4 and 5. These data are obtained from official reports from the Direccion General de Aeronautica Civil, Chile ([[https://climatologia.meteochile.gob.cl/application/publicaciones/documentoPdf/hela](https://climatologia.meteochile.gob.cl/application/publicaciones/documentoPdf/hela)]([https://climatologia.meteochile.gob.cl/application/publicaciones/documentoPdf/hela](https://climatologia.meteochile.gob.cl/application/publicaciones/documentoPdf/hela)) das/heladas004 PUDAHUEL.pdf (accessed on 11 July 2025)) and also from official reports published by the Government of Chile ([[https://climatologia.meteochile.go](https://climatologia.meteochile.go)]([https://climatologia.meteochile.go](https://climatologia.meteochile.go)) b.cl/publicaciones/heladas/heladas007 TANUME.pdf (accessed on 11 July 2025)). Then, the threat levels for each range of values are shown in Table 2.
* Drought. To model drought periods, we use the _Standardized Precipitation Index_ (SPI). This index allows for describing moisture or drought conditions through a single value. It is constructed based on historical precipitation amounts. Since the values obtained in the index calculation process are typically derived using a normal distribution, values around zero indicate normal drought and moisture conditions, while negative values represent various drought conditions. The drought values and levels are obtained from [32]. Table 3 shows the corresponding SPI values, drought levels, and associated threats. * Heatwave. The number of days experiencing heatwaves is calculated for each individual month with data obtained from the Direccion General de Aeronautica Civil, Chile([[https://climatologia.meteochile.gob.cl/application/historico/temperatureA](https://climatologia.meteochile.gob.cl/application/historico/temperatureA)]([https://climatologia.meteochile.gob.cl/application/historico/temperatureA](https://climatologia.meteochile.gob.cl/application/historico/temperatureA)) HistoricaAnnal/330020 (accessed on 11 July 2025)). This is achieved through a prediction of maximum temperature values using an ARIMA model [33; 34]. Table 4 shows the ranges with the number of days in a month affected by a heatwave and the associated threat level. * Pests. This threat level is randomly generated when each land is instantiated. We simulate pests such as Bagrada hilaris, Painted bug, Halyomorpha halys, Stink bug, Bacterial wilt, and Spotted wing drosophila ([[https://www.sag.gob.cl/ambitos-de-acion/plagas-y-enferredades](https://www.sag.gob.cl/ambitos-de-acion/plagas-y-enferredades)]([https://www.sag.gob.cl/ambitos-de-acion/plagas-y-enferredades](https://www.sag.gob.cl/ambitos-de-acion/plagas-y-enferredades)) (accessed on 11 July 2025)). Figure 4: Percentage of probability of at least one frost occurring in the month, (**a**) based on data recorded between 1991 and 2020 in the metropolitan city of Santiago and (**b**) based on data recorded between 2000 and 2004 for the sixth region [35]. Figure 5: Percentage probability that the minimum temperature recorded during a frost is within a certain range of values.