# Parallel Agent-Based Framework for Analyzing Urban Agricultural Supply Chains
## 6 Experiments
### Parallel Simulator Assessment  
We run the parallel experiments with the configuration #19, which reported the best MAPE results. In Figure 13, we show the results obtained by the Simulated Annealing metaheuristic when the simulator is executed in \(P=8\) processors. At left, we show the workload reported by each processor. The workload distribution per simulated day and per processor is homogeneous across partitions (processors 0 to 7), although it varies from day to day. Notice that there is no workload on Mondays. This is correct, as open fairs do not operate on the first day of the week. At right, we show the number of product items (open-fairs, farmers, FWs, consumers) assigned to each processor. The orange bars show the average number of items assigned to the processors over the months, and in green, the number of products assigned to each processor. This graph shows that the distribution is similar for each processor. In the following experiments, we show the results achieved with the baseline simulator (without the credit load balance algorithm) and the credit-based simulator. Additionally, we implemented two versions of the parallel and the sequential simulators. The first one  
Figure 12: Percentage variation in MAPE under environmental risk scenarios. The heatmap shows the sensitivity of the simulator’s predictive accuracy to different stress levels of heatwaves (heat), frosts (frost), and droughs (spi). Columns represent increasing or decreasing scenario intensities (lo1, lo2, hi1, hi2), where “lo” scenarios reduce risk levels and “hi” scenarios increase them. Figure 13: Results obtained by simulated annealing. **(Left)**: Workload reported by each processor. **(Right)**: Number of products and items assigned to each processor. executes atomic events for each task detailed in Figure 1. In the second version, the events associated with the tasks \"Purchase between fairground workers and farmers\" and \"Purchase between fairground workers and customers\" are grouped into a single event. This is because using the atomic version, the number of events can easily exceed 300 million; meanwhile, with the grouped version, the number of events averages around 4.3 million. Figures 14 and 15 show the speedup obtained for the baseline parallel simulator when running the atomic (left) and the grouped (right) versions for the metropolitan city of Santiago and the sixth region of Chile, respectively. The \(x\) axis shows the number of processors. In both cases, the speedup tends to improve with a greater number of processors. Experiments executed with \(W=48\) for the metropolitan city of Santiago produce better results. In the case of the sixth region of Chile, results obtained with \(W=48\) report good speedup, but the best speedup is obtained with \(W=6\) and \(W=24\) with 16 processors. This is because the sixth region involves a smaller number of simulated agents. As a result, increasing the number of processors does not lead to a significant speedup, since the workload is not large enough to fully utilize the available computational resources. Figures 16 and 17 show the speedup for the credit-based parallel algorithm when running the atomic (left) and the grouped (right) versions for the metropolitan city of Santiago and the sixth region of Chile, respectively. In the first case, the values \(W=72\) and \(W=168\) report the best speedups when using more than 16 processors. With fewer processors, the results tend to be similar, with a slight advantage when using \(W=45\). The results for the sixth region indicate that for \(P\leq 16\), using \(W=48\) yields a good speedup. However, when scaling up to \(P=32\), the best speedup is achieved with \(W=168\). This is primarily because the amount of work on each processor is reduced, and a larger time window decreases the overall number of synchronization operations across processors. Additionally, the credit-based algorithm tends to reduce the number of executed iterations, as it assumes that farmers will have the requested quantity of products.