The self-stimulating rat performs foraging tasks mediated by simple computations that use interreward intervals and subjective reward magnitudes to determine stay durations. This is a simplified preparation in which to study the neurobiology of the elementary computational operations that make cognition possible, because the neural signal specifying the value of a computationally relevant variable is produced by direct electrical stimulation of a neural pathway. Newly developed measurement methods yield functions relating the subjective reward magnitude to the parameters of the neural signal. These measurements also show that the decision process that governs foraging behavior divides the subjective reward magnitude by the most recent interreward interval to determine the preferability of an option (a foraging patch). The decision process sets the parameters that determine stay durations (durations of visits to foraging patches) so that the ratios of the stay durations match the ratios of the preferabilities.