parameters: (self, colony)
docstring: The strategy function is called by ants.AntColony each turn
docstring_summary: The strategy function is called by ants.AntColony each turn
docstring_tokens: The strategy function is called by ants . AntColony each turn
function: def strategy(self, colony):
          """The strategy function is called by ants.AntColony each turn"""
          # Have we initialized our graphics yet?
          if not self.initialized:
              # No, so do that now
              self.initialize_colony_graphics(colony)
          elapsed = 0  # Physical time elapsed this turn
          self.saveState("time", int(elapsed))
          while elapsed < STRATEGY_SECONDS:
              self.saveState("time", colony.time)
              self._update_control_panel(colony)
              sleep(0.25)
              elapsed += 0.25
function_tokens: def strategy ( self , colony ) : # Have we initialized our graphics yet? if not self . initialized : # No, so do that now self . initialize_colony_graphics ( colony ) elapsed = 0 # Physical time elapsed this turn self . saveState ( "time" , int ( elapsed ) ) while elapsed < STRATEGY_SECONDS : self . saveState ( "time" , colony . time ) self . _update_control_panel ( colony ) sleep ( 0.25 ) elapsed += 0.25