from pyro.brain import Brain

class SimpleBrain(Brain):
   """
   This brain moves forward, printing out the current
   front sensor readings.  Pretty boring.
   """
   def setup(self):
      # speed of the robot
      self.moveAmount = 0.3

   def step(self):
      frontSensorValues = [s.distance() for s in self.robot.range['front']]
      print 'min front sensor =', min(frontSensorValues)
      # moveAmount determines translation speed, with no rotation
      self.robot.move(self.moveAmount, 0)


def INIT(engine):
   return SimpleBrain('SimpleBrain', engine)
