def run(self, *args, **kwargs): if 'agent_set' in args and args['agent_set'] is None: logger.log_status("Development project dataset is empty. Skip DPLCM") return elif kwargs.has_key('agent_set') and kwargs['agent_set'] is None: logger.log_status("Development project dataset is empty. Skip DPLCM") return else: return AgentLocationChoiceModel.run(self, *args, **kwargs)
def run(self, *args, **kwargs): if 'agent_set' in args and args['agent_set'] is None: logger.log_status( "Development project dataset is empty. Skip DPLCM") return elif kwargs.has_key('agent_set') and kwargs['agent_set'] is None: logger.log_status( "Development project dataset is empty. Skip DPLCM") return else: return AgentLocationChoiceModel.run(self, *args, **kwargs)
def run(self, specification, coefficients, agent_set, agents_index=None, **kwargs): if agents_index is None: agents_index = arange(agent_set.size()) data_objects = kwargs.get("data_objects", {}) if data_objects is not None: self.dataset_pool.add_datasets_if_not_included(data_objects) # filter out agents for this group new_agents_index = self.group_member.get_index_of_my_agents( agent_set, agents_index, dataset_pool=self.dataset_pool ) choices = AgentLocationChoiceModel.run( self, specification, coefficients, agent_set, agents_index=agents_index[new_agents_index], **kwargs ) result = resize(array([-1], dtype=choices.dtype), agents_index.size) result[new_agents_index] = choices return result
def run(self, specification, coefficients, agent_set, agents_index=None, **kwargs): if agents_index is None: agents_index = arange(agent_set.size()) data_objects = kwargs.get("data_objects", {}) if data_objects is not None: self.dataset_pool.add_datasets_if_not_included(data_objects) # filter out agents for this group new_agents_index = self.group_member.get_index_of_my_agents( agent_set, agents_index, dataset_pool=self.dataset_pool) choices = AgentLocationChoiceModel.run( self, specification, coefficients, agent_set, agents_index=agents_index[new_agents_index], **kwargs) result = resize(array([-1], dtype=choices.dtype), agents_index.size) result[new_agents_index] = choices return result