Locating and navigation mechanism based on place-cell and grid-cell models