The ecological relevance of sleep: the trade-off between sleep, memory and energy conservation