original_docstring:  Find the primitive actions driven by a set of goals 
docstring: Find the primitive actions driven by a set of goals
docstring_tokens: Find the primitive actions driven by a set of goals
code: def step_down(self):
          """ Find the primitive actions driven by a set of goals """
          # Propogate the deliberation_goal_votes down through the gearboxes
          agent_surprise = 0.0
          cable_goals = np.zeros((self.bundles_per_gearbox, 1))
         
          for gearbox in reversed(self.gearboxes):
              cable_goals = gearbox.step_down(cable_goals)
              if np.nonzero(gearbox.surprise)[0].size > 0:
                  agent_surprise = np.sum(gearbox.surprise)
          # Tabulate and record the surprise registered in each gearbox
          self.recent_surprise_history.pop(0)
          self.recent_surprise_history.append(agent_surprise)
          self.typical_surprise = np.median(np.array(
                  self.recent_surprise_history))
          mod_surprise = agent_surprise - self.typical_surprise
          self.surprise_history.append(mod_surprise)
          # Report the action that resulted for the current time step.
          # Strip the actions off the cable_goals to make 
          # the current set of actions.
          action = cable_goals[:self.num_actions,:] 
          return action
code_tokens: def step_down ( self ) : agent_surprise = 0.0 cable_goals = np . zeros ( ( self . bundles_per_gearbox , 1 ) ) for gearbox in reversed ( self . gearboxes ) : cable_goals = gearbox . step_down ( cable_goals ) if np . nonzero ( gearbox . surprise ) [ 0 ] . size > 0 : agent_surprise = np . sum ( gearbox . surprise ) self . recent_surprise_history . pop ( 0 ) self . recent_surprise_history . append ( agent_surprise ) self . typical_surprise = np . median ( np . array ( self . recent_surprise_history ) ) mod_surprise = agent_surprise - self . typical_surprise self . surprise_history . append ( mod_surprise ) action = cable_goals [ : self . num_actions , : ] return action
short_docstring: Find the primitive actions driven by a set of goals
short_docstring_tokens: Find the primitive actions driven by a set of goals
comment: """ Find the primitive actions driven by a set of goals """$SEP$# Propogate the deliberation_goal_votes down through the gearboxes$SEP$# Tabulate and record the surprise registered in each gearbox$SEP$# Report the action that resulted for the current time step.$SEP$# Strip the actions off the cable_goals to make $SEP$# the current set of actions.