Hello Hari,
I would highly suggest putting a breakpoint into the loop, and checking the values for your various variables at each timestep to make sure they are updating correctly. You can narrow down on the problem, and change the condition on the breakpoint so that it only stops on certain situations if you want a more advanced maneuver.
From looking at the code though, I can see a few potential issues. One is that your only possible way to get out of the loop is by hitting a breakpoint in a conditional. So clearly the conditional is never true. I suspect you need to index into current_time like you do everywhere else, otherwise number_of_robots_in_nest_initial(current_time) is probably an array. I also suspect that there are better ways of storing information than indexing an array by a time array indexed by a counter. Doesn't make a lot of sense.
Finally, I'd suggest reconsidering your program flow. Since it seems like you always search then assess, and never go back from recruiting to searching or assessing, you could do something like:
while <time is low enough>
% Search
% Assess
end
while <not enough robots>
% Recruit
end
-Cam