parameters: (self, r, c, observations)
return_statement: return v
docstring: we override the get_action method so that we can teleport from place to place
docstring_summary: we override the get_action method so that we can teleport from place to place
docstring_tokens: we override the get_action method so that we can teleport from place to place
function: def get_action(self, r, c, observations):
          """
          we override the get_action method so that we can teleport from place to place
          """
          if not self.goal: # first, figure out where we are trying to go
              (r2, c2) = self.dequeue()
              get_environment().unmark_maze_agent(r2, c2)
              get_environment().mark_maze_yellow(r2, c2)
              self.goal = (r2, c2)
          # then, check if we can get there
          r2, c2 = self.goal
          dr, dc = r2 - r, c2 - c
          action = get_action_index((dr, dc)) # try to find the action (will return None if it's not there)
          v = self.constraints.get_instance() # make the action vector to return
          # first, is the node reachable in one action?
          if action is not None and observations[2 + action] == 0:
              v[0] = action # if yes, do that action!
          else:
              # if not, we should teleport and return null action
              get_environment().teleport(self, r2, c2)
              v[0] = MAZE_NULL_MOVE
          return v
function_tokens: def get_action ( self , r , c , observations ) : if not self . goal : # first, figure out where we are trying to go ( r2 , c2 ) = self . dequeue ( ) get_environment ( ) . unmark_maze_agent ( r2 , c2 ) get_environment ( ) . mark_maze_yellow ( r2 , c2 ) self . goal = ( r2 , c2 ) # then, check if we can get there r2 , c2 = self . goal dr , dc = r2 - r , c2 - c action = get_action_index ( ( dr , dc ) ) # try to find the action (will return None if it's not there) v = self . constraints . get_instance ( ) # make the action vector to return # first, is the node reachable in one action? if action is not None and observations [ 2 + action ] == 0 : v [ 0 ] = action # if yes, do that action! else : # if not, we should teleport and return null action get_environment ( ) . teleport ( self , r2 , c2 ) v [ 0 ] = MAZE_NULL_MOVE return v