Reinforcement learning with cognitive maps