Dynamics of task switching in harvester ants