예제 #1
0
    def __init__(self):
        config = Baseline()

        config_changes = {
            'description':
            'Run REPM and HLCM with bidding choice only',
            'models': [
                "real_estate_price_model",
                "household_relocation_model",
                "household_location_choice_model_with_price_adj",
            ],
            #            'models_in_year': {2000:
            #                               [   "household_relocation_model_for_2000",
            #                                   "household_location_choice_model_for_2000",]
            #                           },
            'years': (2001, 2001),
        }
        config.replace(config_changes)
        config["models_configuration"][
            "household_location_choice_model_with_price_adj"] = {}
        config["models_configuration"]["household_location_choice_model_with_price_adj"]["controller"] = \
              HouseholdLocationChoiceModelWithPriceAdjConfigurationCreator(
                  location_set = "building",
                  sampler = "opus_core.samplers.weighted_sampler",
                  sample_size_locations = 50,
                  input_index = 'hrm_index',
            #                  filter = 'building.unit_price',
                  demand_string="demand",
                  capacity_string = "urbansim_parcel.building.vacant_residential_units",
                  nchunks=1,
                  lottery_max_iterations=20
                  ).execute()
        #        config['models_configuration']['household_location_choice_model_with_price_adj']['controller']['run']['arguments']['chunk_specification'] = "{'nchunks':1}"
        self.merge(config)
예제 #2
0
    def __init__(self):
        config = Baseline()

        config_changes = {
            'description':
            'assigning jobs to workers',
            'models': [
                #"process_pipeline_events",
                "real_estate_price_model",
                "expected_sale_price_model",
                "development_proposal_choice_model",
                "building_construction_model",
                "household_transition_model",
                "employment_transition_model",
                "household_relocation_model",
                "household_location_choice_model",
                "employment_relocation_model",
                {
                    "employment_location_choice_model": {
                        'group_members': '_all_'
                    }
                },
                "work_at_home_choice_model",
                "workplace_choice_model_for_resident",
                'distribute_unplaced_jobs_model'
            ],
            #                {2001:[ "work_at_home_choice_model",],
            #                              2002:[ "workplace_choice_model_for_resident" ] },
            'years': (2001, 2006),
            #            'datasets_to_cache_after_each_model':['person'],
        }

        from psrc.configs.create_travel_model_configuration import create_travel_model_configuration
        travel_model_configuration = create_travel_model_configuration(
            'baseline_travel_model_psrc_2008_lmwang',
            emme2_batch_file='MODEL1-0.BAT',
            mode='full',
            years_to_run={
                2005: '2006_v1.0aTG',
                2010: '2010_v1.0aTG',
                2015: '2010_v1.0aTG_2015',
                2020: '2020_v1.0aTG'
            })
        config['travel_model_configuration'] = travel_model_configuration
        config.replace(config_changes)

        self.merge(config)
    def __init__(self):
        config = Baseline()

        config_changes = {
            'description': 'assigning jobs to workers',
            'models_in_year': {
                2001: [
                    "work_at_home_choice_model",
                ],
                2002: ["workplace_choice_model_for_resident"]
            },
            'years': (2001, 2002),
            'datasets_to_cache_after_each_model': ['person'],
        }
        config.replace(config_changes)

        self.merge(config)
        self['models_configuration']['work_at_home_choice_model'][
            'controller']['run']['arguments']['run_choice_model'] = False
        self['models_configuration']['work_at_home_choice_model'][
            'controller']['run']['arguments'][
                'choose_job_only_in_residence_zone'] = False
                'person_id': arange(len(hh_ids)) + 1,
                'household_id': array(hh_ids),
                'member_id': array(member_ids),
                'is_worker': array(is_worker),
                'job_id': array(job_ids),
            },
        )

        persons = PersonDataset(in_storage=in_storage,
                                in_table_name=persons_table_name)
        persons.write_dataset(out_storage=out_storage,
                              out_table_name=persons_table_name)


if __name__ == '__main__':
    config = Baseline()
    config.replace(
        {
            'scenario_database_configuration':
            ScenarioDatabaseConfiguration(
                database_name='psrc_2005_parcel_baseyear', ),
            'estimation_database_configuration':
            EstimationDatabaseConfiguration(
                database_name='psrc_2005_parcel_baseyear_change_20080219', ),
            'dataset_pool_configuration':
            DatasetPoolConfiguration(
                package_order=['urbansim_parcel', 'urbansim', 'opus_core'], ),
            'low_memory_mode':
            False,
            'cache_directory':
            '/urbansim_cache/psrc_parcel/persons',