Evolution, rewards, and artificial intelligence