To maintain the number of food tokens at the desired level, the swarm should use effective self-organized TA to respond to its changing environment. We employ a control strategy based on the ASM to control the movement of each robot. Herein, we propose the DRTM to generate self-organized TA to adjust the number of foraging robots dynamically.
3.1. Attractor Selection Model (ASM)
Inspired by the dynamic behavior of biomolecules that can adapt to a new, unknown, and noisy environment [
33], Kashiwagi et al. proposed a simple and robust ASM to respond robustly to unknown environmental changes without requiring a large number of specific sensors and transducers [
34].
The ASM is simple and does not require a model of the environment. It is therefore robust to unknown environmental changes. Therefore, we propose a method for controlling a robot’s movement based on the ASM. The ASM is described by the following Langevin equation:
where x and f(x) represent the state and the dynamics of the ASM, respectively. The function f(x) can be designed to have some attractors, and ε is a noise term. The term A(t) is the called ‘activity’ variable and indicates the fitness of the current state to the environment. To apply the ASM to robot control, we interpret the state x as the posture (position and orientation) of the robot, therefore represents the motion of the robot. The function f(x) is designed to have some attractors that are related to particular motions. In swarm foraging, when the robot is in state SS, the attractors are the food; when the robot is in state SR, the attractor is the light within the nest. When the foraging robot discovers an attractor, it keeps advancing to approach the corresponding attractor. The activity A(t) can also be considered as the ASM’s input variable, with A(t) = {0, 1}. When the robot detects an attractor, A(t) is set to 1; at this point, f(x)×A(t) controls the motion of the robot, and the robot approaches the attractor. If the robot detects no attractors, A(t) is set to 0; ε controls the motion of the robot, and the robot performs a random walk to search for attractors.
As given in
Table 1, at the outset of state
SS the fitness of the current state to the environment is
A(
t) = 0; the robot’s motion is controlled by the noise ε and the robot performs a random walk to search for food. When the robot detects a food token, the activity is set to
A(
t) = 1; the robot’s motion is then controlled by
f(
x)×
A(
t) and the robot advances to approach the food token. After capturing the food token, the robot switches to state
SR. A light source is set up in the nest, and the robot returns to the nest by tracking the light. In state
SR, the robot walks randomly to detect the light with
A(
t) = 0. When the robot detects the light, the activity is set to
A(
t) = 1;
f(
x)×
A(
t) then controls the robot’s motion and the robot advances to approach the light. After depositing the food token in the nest, the robot switches to state
SW.
3.2. Dynamical Response Threshold Model (DRTM)
To complete the foraging task, we should maintain the swarm energy at the desired level. The food tokens collected by the foraging robots can increase the swarm energy. However, the foraging activities (e.g., the movements of the foraging robots) and interference among robots constitute a loss of swarm energy. The swarm’s nest can also constitute a loss of energy at a certain rate (Crate). Therefore, the amount of food (or energy) in the nest will decrease gradually, and when there are fewer food tokens than the desired level, the robots tend to go foraging based on the DRTM. By adjusting the number of foraging robots, the DRTM can complete effective TA and improve foraging efficiency. The DRTM accounts for the TFD and the amount of obstacle avoidance to adjust the response threshold dynamically. In the DRTM, the foraging behavior of an individual robot is influenced by the external stimulus (S(t)) and the response threshold (θ).
The external stimulus
S(
t) reflects the amount of food in the nest and is defined as
where
Fd is the desired number of food tokens to be maintained in the nest and
F(
t) is the number of food tokens in the nest at time
t. The stimulus
S(
t) measures the gap between the existing number of food tokens and the desired number. Larger
S(
t) means far fewer existing food tokens than desired, and therefore many more robots will be allocated to foraging. Conversely, with smaller
S(
t), fewer robots tend to go foraging. When
S(
t) ≤ 0, there are the desired number of food tokens and the robots stop going foraging.
In swarm foraging, physical interference refers mainly to obstacle avoidance. If a foraging robot detects an obstacle (e.g., another robot or a wall), it executes avoidance behavior, namely turning away from the obstacle. Such avoidance behavior may interrupt the state of the robot, and after resolving a collision, the robot may spend much time reentering its previous state. For example, if a robot advances toward its nest in a straight line by tracking the light, obstacle avoidance can cause the robot deviate from its route. After resolving the collision, the robot searches for the light once again in random walk, thereby taking longer to return to the nest. Therefore, obstacle avoidance consumes more energy and decreases foraging efficiency. To have fewer obstacle avoidance events (OAEs), we propose two measurements to evaluate the traffic conditions upon which the number of active foraging robots is adjusted dynamically. One is the TFD and the other is the average number of OAEs.
In swarm foraging, the number of OAEs is related not only to the number of active foraging robots but also to the size of the foraging arena. To assess quantitatively how the number of foraging robots and the size of the foraging arena impact the foraging task, we newly introduce the concept of TFD. As a basic concept in traffic engineering, the TFD denotes the number of vehicles within one or several lanes on a unit length of road [
35] and is defined as
where
NV is the number of vehicles on the road and
L is the length of the road. The TFD can reflect the traffic conditions directly and has been widely used in traffic engineering. When
k is large, there is traffic congestion on the road; otherwise, the traffic is flowing smoothly. Based on the size of the TFD, different traffic management and control measures are adopted to regulate the road traffic to improve traffic efficiency.
Herein, the TFD is newly used to calculate the density of foraging robots. The logical extension of Equation (3) is
where
L is the side length of the foraging arena (in this foraging scenario, robots roam a square area, so the amount of available space is
L×
L),
Nr is the total number of robots in the swarm foraging, and
NW is the number of robots in state
SW. Therefore,
Nr-NW denotes the number of active foraging robots. In swarm foraging, the TFD is the number of active foraging robots per unit area and can be used to reflect the traffic conditions. As can be seen from Equation (4), when
k is large, many robots are foraging. Much more obstacle avoidance will be generated, thereby reducing the foraging efficiency, meaning that we should decrease the number of active foraging robots.
The average number of OAEs
MA within a period of time
T2 can also reflect the traffic situation, and
MA is defined as
where
MT2 is the total number of OAEs over time
T2. When there is traffic congestion, more avoidance behavior arises; when the traffic is moving smoothly, less avoidance behavior arises. However, traffic conditions change with time, and the number of OAEs reflects the traffic conditions over time
T2. Therefore, we need to choose a suitable time period over which to calculate the number of OAEs. Too big or too small a time period
T2 will not reflect the traffic conditions correctly. The number of OAEs due to robots within state
SR can well reflect the traffic conditions. Any robot in state
SR can return to the nest in
L/2
v seconds, where v is the robot’s speed and
L/2 is half the side length of the foraging arena; therefore, we set
T2 =
L/2
v. The greater
MA, the heavier the traffic congestion, meaning that we should decrease the number of active foraging robots.
In the DRTM, the response threshold changes dynamically and is defined as
where
α and
β are adjustment factors used to regulate the contributions of
k and
MA, respectively. The quantity
θ can reflect the traffic conditions. As can be seen from Equation (6),
k and
MA together adjust the value of threshold
θ. Larger
θ means traffic congestion in the foraging arena, and therefore fewer robots should be allocated to foraging. Conversely, smaller
θ means that many more robots should go foraging.
In the DRTM, the state transition probability
Ps, which is the probability of leaving the nest to perform foraging, is defined as
where
n determines the slope of the probability function; different values of
n may produce different responses for the same threshold
θ and stimulus
S(
t). The value of
n is set randomly for each robot at the outset of foraging to avoid all robots working simultaneously. The larger the stimulus
S(
t), the less food there is in the nest for a given desired amount of food; under such circumstances, the foraging probability
Ps increases. Conversely,
Ps decreases when
S(
t) is smaller. When
S(
t)≤0, there is the desired number
Fd of food tokens in the nest and the robots can stop foraging. The traffic conditions can also affect the foraging probability;
Ps decreases when traffic congestion occurs and increases when the traffic is flowing smoothly. As can be seen from Equation (7), the food information
S(
t) and environment information
θ together adjust the foraging probability, and therefore the swarm allocates a differing number of robots to go foraging based on the foraging probability. Therefore, the DRTM can not only reduce the amount of physical interference among the robots but also ensure that the foraging task can be completed.
Figure 2 shows probability response curves for various values of
θ and
n. According to
Figure 2, when the threshold
θ is equal to the stimulus
S(
t), the foraging probability is 0.5. Therefore, the robot with the lowest
θ responds fastest to the external stimulus. A robot with a higher threshold
θ is less sensitive to the external stimulus and tends to wait for longer in the nest. As shown in
Figure 2,
n determines the speed at which the robot responds to changes in the stimulus. Robots with larger
n have a steeper curve that will increase their foraging probability more abruptly when the external stimulus
S(
t) increases.
Figure 3 shows a flowchart of DRTM-based swarm foraging. Robots in state
SW use the DRTM to calculate their foraging probability
Ps. Based on
Ps and roulette wheel selection, an individual robot determines whether or not to go foraging. If the robot goes foraging, its foraging behavior is controlled by the ASM as described in Sect. 3.1.
3.4. Performance Measures
This subsection describes three performance indexes used to evaluate the effectiveness of the proposed method. The purpose of swarm foraging is to maintain the food in the nest at the desired level, therefore the average deviation of food (ADF) in the nest (
Vf) is an important index with which to measure the performance. It is defined as
where
Fd is the desired number of food tokens and
F(
t) is the number of net food tokens (the food collected by the swarm minus the food consumed by the swarm) at time
t in the nest. Measure
Vf denotes the gap between the existing number of food tokens in the nest and the desired number. As such,
Vf can be used to assess both the robots’ abilities to adapt to changes in the external stimulus and the effect of TA. Smaller
Vf not only indicates that the swarm can maintain a food level that is closer to the desired value
Fd but also proves that the TA is more able to adapt to changes in the food supply.
During a mission, the robots’ movements, the OAEs, and the nest all consume energy that comes from the food collected by the robots. Therefore, the energy efficiency (
Ee) is introduced as a performance measure. It is defined as
where
En is the net food energy and
ET is the total energy collected by the robots. Smaller
Ee implies that the swarm consumes more energy and that the TA leads to less-efficient foraging.
To reduce the amount of physical interference among the robots, we use the TFD and the number of OAEs to adjust the value of threshold θ dynamically. Therefore, the average number of OAEs M
v is also considered as a performance measure:
where
MT is the total number of OAEs during foraging and
Nr is the total number of robots engaged in foraging. Because obstacle avoidance consumes energy and causes traffic congestion,
Mv reflects the foraging efficiency and the adaptive ability to deal with the traffic congestion.