equal to zero, are purged from $IRep$. The new $Ab$ with ID 1 is then added to the currently empty list $CandAbs$.

$\epsilon \gets Constant$; $IRep,XRep,CandAb \gets \varnothing$;

$Ep \gets fetchSensorValues()$; $\psi \gets measureAffinity(Ep,Pt_i)$; \[measureaff\] $agStimulation(\psi,Ab_i)$; $CandAbs \gets append(Ab_i)$;

$NewAb \gets createNewAntibody(Ep)$; \[createnew\] $CandAbs \gets append(NewAb)$; $IRep \gets append(NewAb)$; $BestAb \gets selectBestAntibody(CandAbs)$; \[selectbest1\] $BestAb \gets selectBestAntibody(XRep)$; \[selectbest2\] Execute and Evolve $BestAb$ using an EA; $CandAb,XRep \gets \varnothing$;

For final execution by the robot, the best $Ab$ is selected from either $XRep$ or the list of $CandAbs$ based on a probability $P_{sharing}$. The $selecBestAntibody$ function (lines \[selectbest1\] and \[selectbest2\]) selects the matching $Ab$ ($\psi \leq \epsilon$) having the highest $C$ value. The $Ctr$ of the best $Ab$ is evolved in order to produce the adequate behaviour within the associated $AR$. When the robot is executing a controller of the selected $Ab$, the environmental state is continuously sampled. It may be noted that during the task execution, if the $Ep$ sampled from the environment is outside the $AR$ of the currently selected best $Ab$, the current task execution is stopped and the process to select and evolve a new $Ab$ recommences.

The algorithm partitions the environment (antigenic) space sensed by the robot 