original_docstring: 
          Take a step, implemented as a PID controller
          
docstring: Take a step, implemented as a PID controller
docstring_tokens: Take a step implemented as a PID controller
code: def step(self, delta_time, closest_curve_point, objects):
          """
          Take a step, implemented as a PID controller
          """
  
          # Find the curve point closest to the agent, and the tangent at that point
          closest_point, closest_tangent = closest_curve_point(self.pos, self.angle)
  
          iterations = 0
  
          lookup_distance = self.follow_dist
          curve_point = None
          while iterations < self.max_iterations:
              # Project a point ahead along the curve tangent,
              # then find the closest point to to that
              follow_point = closest_point + closest_tangent * lookup_distance
              curve_point, _ = closest_curve_point(follow_point, self.angle)
  
              # If we have a valid point on the curve, stop
              if curve_point is not None:
                  break
  
              iterations += 1
              lookup_distance *= 0.5
  
          # Compute a normalized vector to the curve point
          point_vec = curve_point - self.pos
          point_vec /= np.linalg.norm(point_vec)
  
          dot = np.dot(self.get_right_vec(self.angle), point_vec)
          steering = self.gain * -dot
  
          self._update_pos([self.velocity, steering], delta_time)
code_tokens: def step ( self , delta_time , closest_curve_point , objects ) : closest_point , closest_tangent = closest_curve_point ( self . pos , self . angle ) iterations = 0 lookup_distance = self . follow_dist curve_point = None while iterations < self . max_iterations : follow_point = closest_point + closest_tangent * lookup_distance curve_point , _ = closest_curve_point ( follow_point , self . angle ) if curve_point is not None : break iterations += 1 lookup_distance *= 0.5 point_vec = curve_point - self . pos point_vec /= np . linalg . norm ( point_vec ) dot = np . dot ( self . get_right_vec ( self . angle ) , point_vec ) steering = self . gain * - dot self . _update_pos ( [ self . velocity , steering ] , delta_time )
short_docstring: Take a step, implemented as a PID controller
short_docstring_tokens: Take a step implemented as a PID controller
comment: """
          Take a step, implemented as a PID controller
          """$SEP$# Find the curve point closest to the agent, and the tangent at that point$SEP$# Project a point ahead along the curve tangent,$SEP$# then find the closest point to to that$SEP$# If we have a valid point on the curve, stop$SEP$# Compute a normalized vector to the curve point