def __my_configuration(self):
        tables_to_cache = Baseline(
        )['creating_baseyear_cache_configuration'].tables_to_cache
        tables_to_cache.append('workers_for_estimation')

        return {
            'cache_directory':
            'D:/urbansim_cache/psrc/estimation',  # change or leave out
            'creating_baseyear_cache_configuration':
            CreatingBaseyearCacheConfiguration(
                #        cache_directory_root = '/tmp/urbcache/sandbox_runs/estimation',
                unroll_gridcells=True,
                cache_from_database=True,
                baseyear_cache=BaseyearCacheConfiguration(
                    existing_cache_to_copy=r'D:/urbansim_cache/full_psrc', ),
                cache_scenario_database=
                'urbansim.model_coordinators.cache_scenario_database',
                tables_to_cache=tables_to_cache,
                tables_to_cache_nchunks={
                    'parcels': 4,
                    'gridcells': 5
                },
                tables_to_copy_to_previous_years={},
            ),
            'scenario_database_configuration':
            ScenarioDatabaseConfiguration(
                database_name='GSPSRC_2000_baseyear_change_20070102', ),
            'dataset_pool_configuration':
            DatasetPoolConfiguration(
                package_order=['psrc', 'urbansim', 'opus_core'], ),
            'base_year':
            2000,
        }
示例#2
0
 def test_pickling_configuration_doesnt_fail(self):
     config = Baseline()
     pickled_config = None
     try:
         pickled_config = pickle.dumps(config)
     except:
         pass
     self.assertTrue(pickled_config is not None)
示例#3
0
        'development_project_location_choice_model',
        'psrc.estimation.psrc.estimation_DPLCM_variables', 'residential'
    ],
    'rlsm': [
        'residential_land_share_model',
        'psrc.estimation.psrc.estimation_RLSM_variables', None
    ],
}

if __name__ == '__main__':
    #model = 'hlcm'
    #model = 'elcm-industrial'
    #model = 'elcm-commercial'
    #model = 'elcm-home_based'
    model = 'dplcm-industrial'
    #model = 'dplcm-commercial'
    #model ='dplcm-residential'
    #model = 'lpm'
    #model = 'rlsm'

    config = Baseline()
    config.merge(my_configuration)
    config['config_changes_for_estimation'] = ConfigChangesForEstimation()
    estimator = EstimationRunner(models[model][0],
                                 specification_module=models[model][1],
                                 model_group=models[model][2],
                                 configuration=config,
                                 save_estimation_results=True)
    estimator.estimate()
    #estimator.reestimate()
    #estimator.reestimate(submodels=[])
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE

from psrc.configs.baseline import Baseline
from opus_core.database_management.flatten_scenario_database_chain \
    import FlattenScenarioDatabaseChain
from opus_core.database_management.configurations.scenario_database_configuration import ScenarioDatabaseConfiguration
"""
This utility creates a new flattened database containing the
necessary files from the scenario database chain pointed to by
PSRC_2000_baseyear.
"""

run_configuration = Baseline()

from_database_configuration = ScenarioDatabaseConfiguration(
    database_name='PSRC_2000_baseyear')
to_database_configuration = ScenarioDatabaseConfiguration(
    database_name='PSRC_2000_baseyear_flattened')
tables_to_copy = run_configuration[
    'creating_baseyear_cache_configuration'].tables_to_cache

copier = FlattenScenarioDatabaseChain()
copier.copy_scenario_database(
    from_database_configuration=from_database_configuration,
    to_database_configuration=to_database_configuration,
    tables_to_copy=tables_to_copy)