code: def run(self, steps=float('inf')):
          
  
          self.running = True
          activation = None
          execution = 0
          while steps > 0 and self.running:
  
              added, removed = self.get_activations()
              self.strategy.update_agenda(self.agenda, added, removed)
  
              if watchers.worth('AGENDA', 'DEBUG'):  # pragma: no cover
                  for idx, act in enumerate(self.agenda.activations):
                      watchers.AGENDA.debug(
                          "%d: %r %r",
                          idx,
                          act.rule.__name__,
                          ", ".join(str(f) for f in act.facts))
  
              activation = self.agenda.get_next()
  
              if activation is None:
                  break
              else:
                  steps -= 1
                  execution += 1
  
                  watchers.RULES.info(
                      "FIRE %s %s: %s",
                      execution,
                      activation.rule.__name__,
                      ", ".join(str(f) for f in activation.facts))
  
                  activation.rule(
                      self,
                      **{k: v
                         for k, v in activation.context.items()
                         if not k.startswith('__')})
  
          self.running = False
docs: Execute agenda activations