**3. Response threshold model**

This section proposes a new response threshold model using contact stimuli with foraging agents. Firstly, we describe the role that a response threshold model plays in autonomous role assignment and introduce the conventional response threshold model. Next, we describe the proposed response threshold model that uses contact stimuli with foraging agents as external stimuli. There are two types of ants: those sensitive to external stimuli and those insensitive to external stimuli. Sensitivity to external stimuli can be modelled using a parameter called a response threshold. An agent with a low response threshold is likely to become a worker even if its sensitivity to external stimuli is weak; however, an agent with a high response threshold is unlikely to become a worker even if its sensitivity to external stimuli is high. Thus, a response threshold can prevent outcomes in which all agents are workers or nonworkers. In the conventional response threshold model, an agent changes from a worker to a non-worker with probability *p* and changes from a non-worker to a worker with the probability described using the following equation:

*Autonomous Role Assignment Using Contact Stimuli in Swarm Robotic Systems DOI: http://dx.doi.org/10.5772/intechopen.107852*

$$q = \frac{s(t)^2}{s(t)^2 + \theta(t)^2},\tag{1}$$

where *θ* and *s* represent a response threshold and an external stimulus at time *t*, respectively. The response threshold is updated using Eq. (2) if the agent is a worker and using Eq. (3) if it is a non-worker. If the agent is a worker, the response threshold decreases and its sensitivity to external stimuli increases. If the agent is a non-worker, the response threshold increases and its sensitivity to external stimuli decreases.

$$
\theta(t+1) = \theta(t) - \xi. \tag{2}
$$

$$
\theta(t+1) = \theta(t) + \psi. \tag{3}
$$

In the conventional model, a stimulus *s* is updated by the ratio of the number of workers *Nw*ð Þ*t* to the total number of ants *Nt*ð Þ*t* in an ant colony, as described by the following equation:

$$s(t+1) = s(t) + \delta - a \frac{N\_w(t)}{N\_t(t)},\tag{4}$$

where *δ* represents an increase in loads per unit time if no ant forages. The third term on the right side of Eq. (4) represents a decrease in loads per ant to the ratio of the number of workers in the ant colony, and *α* represents a scale factor. That is, if the worker ratio in the ant colony decreases, the stimulus *s* increases with increasing loads per ant and the probability of changing from a non-worker to a worker increases. However, ants cannot know the state of all other ants. Therefore, the above equation cannot represent the mechanism by which ants can form orderly swarms through local interactions. We, therefore, propose a novel equation as follows:

$$
\kappa(t+1) = \beta c \varsigma(t), \tag{5}
$$

$$\csc(t) = c(t) + \wp c(t-1),\tag{6}$$

$$
\omega(t) = \begin{cases}
\mathbf{1} & \text{if an agent contracts with a foreign agent,} \\
\mathbf{0} & \text{otherwise.}
\end{cases}
\tag{7}
$$

In the proposed model, a stimulus *s t*ð Þ þ 1 is updated by multiplying a contact stimulus *cs t*ð Þ by a scale factor *β*. The contact stimulus *cs t*ð Þ decreases by the attenuation rate *γ* over time if an agent does not contact a foraging agent. If an agent contacts a foraging agent, *c t*ð Þ is 1, otherwise 0.
