An on-line algorithm for dynamic reinforcement learning and planning in reactive environments | Synapse