getting state for agents, and updating the agents with this state