Using the past to anticipate the future in human foraging behavior