## 4 The Algorithms
### Population Management Role
#### 4.2.1 Adding Agents into the Group  
Adding agents to the group ensures that there is a sufficient number of agents \(a_{\{f,k,v\}}\) in the given subspace \(s_{\{k,f\}}\) so that it is effectively explored. This addition is not subject to any centralized control. It is based on indirect space coverage estimation by observing the number of conflicts between agents. Each agent \(a_{\{f,k,v\}}\) records the number of conflicts locally in a conflict counter \(CCA_{\{f,k,v\}}\) and checks the number of conflicts periodically after a period \(TRA_{\{f,k,v\}}\) has elapsed. If \(CCA_{\{f,k,v\}}\leq TCa_{\{f,k,v\}}\), where \(TCa_{\{f,k,v\}}\) is an user adjustable parameter, the agent goes to the entrance \(e_{k_{m}}\) it used to enter the subspace \(s_{\{k,f\}}\) and leaves a request there (a pheromone mark \(Pa_{\{f,k,v\}}\)) for adding an agent into its group \(A_{s_{k}}\). Always after \(ta_{\{f,k,v\}}==TRA_{\{f,k,v\}}\) has elapsed, the agent resets its \(CCA_{\{f,k,v\}}\) and \(ta_{\{f,k,v\}}\) counters to zero regardless of if an addition criterion is satisfied or not.  
\[\text{if }ta_{\{f,k,v\}}==TRA_{\{f,k,v\}}\implies CCA_{\{f,k,v\}}=0,ta_{\{f,k,v \}}=0.\]  
The addition request that the agent places at the entrance \(e_{k_{m}}\) is represented by a pheromone mark \(Pena_{\{k,m,f\}}\). The value of \(Pena_{\{k,m,f\}}\) decreases in time:  
\[Pena_{\{k,m,f\}}(t)=\begin{cases}a*Pa_{\{f,k,v\}}&\text{if }Pena_{\{k,m,f\}}(t-1)==0\\ a*Pa_{\{f,k,v\}}+Pena_{\{k,m,f\}}(t-1)-1&\text{if }Pena_{\{k,m,f\}}(t-1)>0\end{cases}, \tag{7}\]  
where \(a\) is a constant, that is, 1 if the agent placed the request at the entrance \(e_{k_{m}}\) in time \((t)\) or 0 if the agent did not. If another agent places an addition request as well, the \(Pena_{\{k,m,f\}}(t)\) increases by \(Pa_{\{f,k,v\}}\) according to the formula above. New agents are added from the agent group \(A_{f}\) automatically, if the following condition is satisfied,  
\[Pena_{\{k,m,f\}}(t)\geq TPea_{\{f,k,v\}}\bigvee(e_{k_{m}}==e_{S_{real}}) \subseteq s_{\{k,f\}}. \tag{8}\]If \((e_{k_{m}}\
eq e_{S_{real}})\lor(e_{y_{m}}==e_{S_{real}})\subseteq s_{\{y,l\}} \lor s_{\{y,l\}}\) and \(s_{\{k,f\}}\) are adjacent subspecies, then agent \(a_{\{l,y,v\}}\), operating in \(s_{\{y,l\}}\), transfers the request from \(e_{k_{m}}\) to \(e_{y_{m}}\) (a more detailed explanation is in Section 4.3.3).  
The following conditions must be also satisfied,  
\[TCa_{\{f,k,v\}}\leq TRa_{\{f,k,v\}}\leq Pa_{\{f,k,v\}}. \tag{9}\]  
If \(TRa_{\{f,k,v\}}\leq Pa_{\{f,k,v\}}\) is not satisfied, then no agent is added into the group \(A_{\text{s}_{k}}\), because the pheromone \(Pena_{\{k,m,f\}}(t)\) at the entrance \(e_{k_{m}}\) was reduced to 0 in a time that is greater than \(TRa_{\{f,k,v\}}\). In other words, if the agents encounter each other too sporadically every agent that recognizes that the given subspace is sparsely populated (by counting conflicts over time) transfers a pheromone mark requesting adding an agent to the entrance. Several agents must do the same for the pheromone mark to become strong enough to exceed the threshold for adding an agent. If an agent comes to the entrance from the outer side of the underpopulated subspace and it encounters the pheromone mark placed at the entrance, it enters the subspace as a consequence.