Caste and task allocation in ants