Using the event calculus to integrate planning and learning in an intelligent autonomous agent