# Dynamic Response Threshold Model for Self-Organized Task Allocation in a Swarm of Foraging Robots
## 3 Results  
### Simulation Experiment  
We conducted simulation experiments under similar conditions to compare the DRTM with ARTM. Each experiment ran for 20 min (\(T=1200\) s) and the simulation algorithm ran 10 times each second, so each experiment involved 12,000 simulation steps. The experimental area was a square area of \(L=4.0\) m and the diameter of the nest was \(d=1.5\) m. The total number of robots was \(N_{r}=20\). The total number of food tokens in the experimental environment was \(N_{f}=20\), and each food token contained 1500 energy units. Each foraging robot consumed one energy unit per step and each OAE consumed \(E_{a}=10\) energy units. The food reserve in the nest was consumed at the rate of 2.0 (food tokens)/min. Following the ARTM, the other parameter settings were \(T_{1}=50\) steps, \(\theta_{t0}=3.3\) (\(1\leq\theta\leq 10\)), integer \(n\) generated randomly (\(2\leq n\leq 9\)), and \(F(0)=5\). To allocate many more robots to go foraging, we set the desired number of food tokens in the nest as \(F_{d}=20\). However, there were no reference standards for selecting parameters \(\alpha\) and \(\beta\), so we chose those values by trial and error; in each experiment, we set \(\alpha=3\) and \(\beta=2\). For each TA model, we repeated the simulation experiments 50 times, averaged the results, and then processed the data using MATLAB. At the beginning of each experiment, there were 5 food tokens in the nest, with the desired number being 20, and the robots were all in the nest. Therefore, the stimulus \(S(t)\) is 15 and threshold \(\theta\) is 3.3. According to Equation (7), the foraging probability \(P_{s}\) is affected mainly by the stimulus \(S(t)\) and many robots are allocated to foraging. The movements of the active foraging robots consume much more energy, meaning that the number of food tokens in the nest decreases rapidly. As the foraging robots delivery food tokens back to the nest continuously, the number of food tokens in the nest increases rapidly. At this stage, many robots are foraging and the threshold \(\theta\) becomes larger in the DRTM. As the stimulus \(S(t)\) decreases gradually, the threshold \(\theta\) and stimulus \(S(t)\) begin together to affect the foraging behavior of the robots. The foraging probability decreases gradually and the rate at which food accumulates decreases. When the number of food tokens within the nest reaches the desired level, the robots stop going foraging. However, because the swarm's nest consumes energy, when the number of food tokens drops below the desired level, the robots begin foraging again. Figure 5 shows how the amount of food in the nest changes, from which we can calculate the ADF (\(V_{f}\)) and the energy efficiency (\(E_{e}\)). Compared with the ARTM (\(V_{f}\) = 4.74), the DRTM (\(V_{f}\) = 2.55) maintains a net amount of food preserved in the nest that is closer to the desired level. The ADF (\(V_{f}\)) shows that the DRTM can respond to changes in food supply more effectively than the ARTM can. At the end of the experiment, the total number of food tokens collected by the DRTM is 173.76 and the net number of food tokens in the nest is 20.84; the corresponding values for the ARTM are 183.46 and 18.34, respectively. Each food token contains 1500 energy units. According to Equation (9), the DRTM (\(E_{e}\) = 11.99%) consumes less energy than the ARTM does (\(E_{e}\) = 9.99%). The energy efficiency (\(E_{e}\)) shows that the DRTM gives rise to more efficient foraging. As shown in Figure 6, the ARTM generates more OAEs in total (\(M_{T}\) = 1148.44) compared to the DRTM (\(M_{T}\) = 925.96). In the DRTM, the swarm adjusts the threshold \(\theta\) in real time according to the traffic conditions, thereby influencing the foraging probability of those robots within state \(S_{W}\). The DRTM encounters fewer obstacles (\(M_{v}\) = 46.30) compared to the ARTM by considering the traffic conditions, and the DRTM possesses better adaptive abilities compared to the ARTM (\(M_{v}\) = 57.42) in dealing with traffic congestion.