Last night Darnell dreamt he was inside a burning house tryi…

Last night Darnell dreamt he was inside a burning house trying to rescue his children. He could hear them screaming but he could not get to them through the smoke and flames. He woke up sweating and was still troubled by it the next morning. Which theory would explain his dream as a way to our way of rehearsing how we would react in dangerous situations?