For a rat, getting hold of an inaccessible tasty treat can be a dream come true.
And that is exactly what a group of the animals imagined doing when they slept, research suggests.
Rats previously shown food in an unreachable location displayed neural activity that indicated they were fantasising about successful foraging missions.
Scientists cannot be sure the rats were dreaming - but the evidence points that way.
If true, the discovery further narrows the gap between humans and other animals by showing that rodents possess an ability to imagine future events.
The findings also shed light on why people who have suffered damage to the hippocampus, the brain's memory centre, find it hard to contemplate the future.
Lead scientist Dr Hugo Spiers, from University College London (UCL), said: "During exploration, mammals rapidly form a map of the environment in their hippocampus.
"During sleep or rest, the hippocampus replays journeys through this map which may help strengthen the memory.
"It has been speculated that such replay might form the content of dreams.
"Whether or not rats experience this brain activity as dreams is still unclear, as we would need to ask them to be sure.
"Our new results show that during rest, the hippocampus also constructs fragments of a future yet to happen.
"Because the rat and human hippocampus are similar, this may explain why patients with damage to their hippocampus struggle to imagine future events."
In the experiment, four rats were allowed to run along a T-junction track and see food being placed in an inaccessible arm.
Another arm of the track contained no food.
The animals were then placed in a sleep chamber for an hour.
Electrode implants in the rats' brains showed that as they slept, mapping nerve cells representing the route to the food were active.
Cells representing the empty arm were not activated the same way.
The food-route pattern of firing nerve cells was the same as that seen later when the rats were allowed free access to all parts of the track.
Co-author Dr Freyja Olafsdottir, also from University College London, said: "What's really interesting is that the hippocampus is normally thought of as being important for memory, with place cells storing details about locations you've visited.
"What's surprising here is that we see the hippocampus planning for the future, actually rehearsing totally novel journeys that the animals need to take in order to reach the food."
The results, published in the online journal eLife, suggest that the rat hippocampus plans future journeys, but only when there is a motivational cue such as food.
Dr Caswell Barry, another member of the UCL team, said: "What we don't know at the moment is what these neural simulations are actually for.
"It seems possible this process is a way of evaluating the available options to determine which is the most likely to end in reward, thinking it through if you like.
"We don't know that for sure though and something we'd like to do in the future is try to establish a link between this apparent planning and what the animals do next."