Assessing predation risk: optimal behaviour and rules of thumb.