The Interpretation of Dreams by Sigmund Freud Chapter 6 Page 31

where the wishing merges into an hallucination, This first psychic activity therefore aims at an identity of perception, i.e. it aims at a repetition of that perception which is connected with the fulfillment of the want.

This primitive mental activity must have been modified by bitter practical experience into a more expedient secondary activity. The establishment of the identity perception on the short regressive road within the apparatus does not in another respect carry with it the result which inevitably follows the revival of the same perception from without. The gratification does not take place, and the want continues. In order to equalize the internal with the external sum of energy, the former must be continually maintained, just as actually happens in the hallucinatory psychoses and in the deliriums of hunger