Self-Adjusting Finite State Machines: an approach to Real-Time Autonomous Behavior in Robots