def _kill_all_units(self):
"""Kill all units on the map. Steps controller and so can throw
exceptions"""
units = [unit.tag for unit in self._obs.observation.raw_data.units]
self._kill_units(units)
# check the units are dead
units = len(self._obs.observation.raw_data.units)
while len(self._obs.observation.raw_data.units) > 0:
self._controller.step(2)
self._obs = self._controller.observe()
What is the additional significance of checking for surviving agents in this code snippet, compared to the method of killing units in SMAC v1, which would cause the program to run idle for a while, thereby extending the training time of the agents?