'Select and bind agents to a given resource.'

def schedule(self, plugin, context, resource):

    if (not self.resource_filter):
        return
    filtered_agents_dict = self.resource_filter.filter_agents(plugin, context, resource)
    num_agents = filtered_agents_dict['n_agents']
    hostable_agents = filtered_agents_dict['hostable_agents']
    hosted_agents = filtered_agents_dict['hosted_agents']
    chosen_agents = self.select(plugin, context, hostable_agents, hosted_agents, num_agents)
    self.resource_filter.bind(context, chosen_agents, resource['id'])
    return chosen_agents
