Hummingbirds and Nectar

After all, is a bird capable of the conscious recognition that it will die if it uses its energy in a fruitless search for food in order to sustain its high metabolism? And can it then decide to improve its memory as a necessary solution to its problem? How does this tiny bird know exactly how long it takes for a flower to refill its supply of nectar, and furthermore, how does it know exactly which flower to return to and remember its flight pattern back to that flower? How does it differentiate between the different flowers?