Learning reactive and planning rules in a motivationally autonomous animat | Synapse