Example #1
0
 def prepare_for_estimate(self, agents_for_estimation_storage, agents_for_estimation_table, agent_set, **kwargs):
     estimation_set = Dataset(in_storage = agents_for_estimation_storage,
                              in_table_name=agents_for_estimation_table,
                              id_name=agent_set.get_id_name(), dataset_name=agent_set.get_dataset_name())
     hhs_est = HouseholdDataset(in_storage=agents_for_estimation_storage, in_table_name='households_for_estimation')
     self.dataset_pool.replace_dataset('household', hhs_est)
     self.dataset_pool.replace_dataset(estimation_set.get_dataset_name(), estimation_set)
     spec, index = ChoiceModel.prepare_for_estimate(self, estimation_set, **kwargs)        
     return (spec, index, estimation_set)
Example #2
0
 def prepare_for_estimate_hh(self, estimation_storage, agents_for_estimation_table, agent_set, 
                          persons_for_estimation_table=None, **kwargs):
     estimation_set = Dataset(in_storage = estimation_storage,
                              in_table_name=agents_for_estimation_table,
                              id_name=agent_set.get_id_name(), dataset_name=agent_set.get_dataset_name())
     if persons_for_estimation_table is not None:
         pers = PersonDataset(in_storage=estimation_storage, in_table_name=persons_for_estimation_table)
         self.dataset_pool.replace_dataset('person', pers)
     self.dataset_pool.replace_dataset(estimation_set.get_dataset_name(), estimation_set)
     spec, index = ChoiceModel.prepare_for_estimate(self, estimation_set, **kwargs)
     return (spec, index, estimation_set)