During a hangover people tend to get all their regrets paraded for them by their brain. The reason for this is interesting. During duress, stress or pain, the brain is programmed by genes to not just avoid the immediate situation at hand but also by association shuffle through the long-term memory to retrieve all the previous, causally related events and episodes, and tell the brain to avoid those as well.
In aggregate this is the same as how reinforcement learning works in machine learning, but somewhat more sophisticated. In #RL, the whole episode is replayed time index by time index backwards and each state in this trajectory will feel the same negative affect, to avoid ending up in similar situations again when the cause for the situation is further down in the past.
Human brain doesn't store the past states like a tape recorder but by association and so retrieval of past causes and assigning credit or penalty is much more efficient.
