'Returns the number of targets that can be added to an agent
without exceeding its `maxwaiting` limit (the returned value
cannot be negative).'

def may_receive(self, agentid):

    agent = self.get_agent(agentid)
    return max((agent['maxwaiting'] - self.count_waiting_targets(agentid)), 0)
