Пример #1
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'no ugb + double-capacity highway'
        self['scenario_database_configuration'].database_name = 'PSRC_2000_scenario_A_no_ugb'

        travel_model_configuration = create_travel_model_configuration('baseline_travel_model_psrc_highway_x_half')
        self['travel_model_configuration'] = travel_model_configuration
Пример #2
0
    def __init__(self):
        Baseline.__init__(self)
        self["description"] = "double-capacity highway with baseline travel model"
        self["scenario_database_configuration"].database_name = "PSRC_2000_baseyear"

        travel_model_configuration = create_travel_model_configuration("baseline_travel_model_psrc_highway_x_half")
        self["travel_model_configuration"] = travel_model_configuration
Пример #3
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'double-capacity highway with baseline travel model'
        self['scenario_database_configuration'].database_name = 'PSRC_2000_baseyear'

        travel_model_configuration = create_travel_model_configuration('baseline_travel_model_psrc_highway_x_half')
        self['travel_model_configuration'] = travel_model_configuration
 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,
     }
Пример #5
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'baseline with no build travel model'

        travel_model_configuration = create_travel_model_configuration('baseline_travel_model_psrc_no_build')
        self['travel_model_configuration'] = travel_model_configuration
        
    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,
        }
Пример #7
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'double-capacity highway with baseline travel model'
        self['scenario_database_configuration'].database_name = 'PSRC_2000_baseyear'

        travel_model_configuration = create_travel_model_configuration('baseline_travel_model_psrc_highway_x_2')
        self['travel_model_configuration'] = travel_model_configuration
Пример #8
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'no ugb with full travel model'
        self['scenario_database_configuration'].database_name = 'PSRC_2000_scenario_A_no_ugb'

        travel_model_configuration = create_travel_model_configuration('baseline_travel_model_psrc')
        self['travel_model_configuration'] = travel_model_configuration
        
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'subset baseline without travel model'
        self['scenario_database_configuration'].database_name = 'PSRC_2000_baseyear_fircrest'
        self['creating_baseyear_cache_configuration'].cache_directory_root = 'c:/urbansim_cache'
        self['years'] = (2001, 2002)

        del self['travel_model_configuration']
Пример #10
0
    def __init__(self):
        Baseline.__init__(self)
        self["description"] = "subset baseline without travel model"
        self["scenario_database_configuration"].database_name = "PSRC_2000_baseyear_fircrest"
        self["creating_baseyear_cache_configuration"].cache_directory_root = "c:/urbansim_cache"
        self["years"] = (2001, 2002)

        del self["travel_model_configuration"]
Пример #11
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'no ugb with full travel model'
        self[
            'scenario_database_configuration'].database_name = 'PSRC_2000_scenario_A_no_ugb'

        travel_model_configuration = create_travel_model_configuration(
            'baseline_travel_model_psrc')
        self['travel_model_configuration'] = travel_model_configuration
Пример #12
0
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'no ugb + double-capacity highway'
        self[
            'scenario_database_configuration'].database_name = 'PSRC_2000_scenario_A_no_ugb'

        travel_model_configuration = create_travel_model_configuration(
            'baseline_travel_model_psrc_highway_x_half')
        self['travel_model_configuration'] = travel_model_configuration
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'configuration for a test run'
        self['scenario_database_configuration'].database_name = 'PSRC_2000_baseyear'
        self['creating_baseyear_cache_configuration'].cache_directory_root = 'c:/urbansim_cache'
        self['creating_baseyear_cache_configuration'].tables_to_cache.append('workers_for_estimation')
        self['years'] = (2001, 2002)

        del self['travel_model_configuration']
    def __init__(self):
        Baseline.__init__(self)
        self['description'] = 'configuration for a test run'
        self[
            'scenario_database_configuration'].database_name = 'PSRC_2000_baseyear'
        self[
            'creating_baseyear_cache_configuration'].cache_directory_root = 'c:/urbansim_cache'
        self['creating_baseyear_cache_configuration'].tables_to_cache.append(
            'workers_for_estimation')
        self['years'] = (2001, 2002)

        del self['travel_model_configuration']
 def __init__(self):
     Baseline.__init__(self)
     
     self['creating_baseyear_cache_configuration'].tables_to_cache.append('exogenous_relationships')
     self['creating_baseyear_cache_configuration'].tables_to_cache.append('weather_exogenous')
     self['creating_baseyear_cache_configuration'].tables_to_cache.append('consumption_re')
     self['creating_baseyear_cache_configuration'].tables_to_cache.append('consumption_co')
     self['creating_baseyear_cache_configuration'].tables_to_cache.append('consumption_mf')
     tables_to_copy_to_previous_years = self['creating_baseyear_cache_configuration'].tables_to_copy_to_previous_years
     for table_name, year in tables_to_copy_to_previous_years.iteritems():
         tables_to_copy_to_previous_years[table_name] = 1995
     self['cache_directory'] = 'c:/urbansim_cache/water_test'
     self['dataset_pool_configuration'] = DatasetPoolConfiguration(
         package_order=['waterdemand', 'psrc', 'urbansim', 'opus_core'],
         )
     self['scenario_database_configuration'].database_name = 'bellevue_consump_agg_month_year'
Пример #16
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)
Пример #17
0
    def __init__(self):
        Baseline.__init__(self)

        self["creating_baseyear_cache_configuration"].tables_to_cache.append("exogenous_relationships")
        self["creating_baseyear_cache_configuration"].tables_to_cache.append("weather_exogenous")
        self["creating_baseyear_cache_configuration"].tables_to_cache.append("consumption_re")
        self["creating_baseyear_cache_configuration"].tables_to_cache.append("consumption_co")
        self["creating_baseyear_cache_configuration"].tables_to_cache.append("consumption_mf")
        tables_to_copy_to_previous_years = self[
            "creating_baseyear_cache_configuration"
        ].tables_to_copy_to_previous_years
        for table_name, year in tables_to_copy_to_previous_years.iteritems():
            tables_to_copy_to_previous_years[table_name] = 1995
        self["cache_directory"] = "c:/urbansim_cache/water_test"
        self["dataset_pool_configuration"] = DatasetPoolConfiguration(
            package_order=["waterdemand", "psrc", "urbansim", "opus_core"]
        )
        self["scenario_database_configuration"].database_name = "bellevue_consump_agg_month_year"
Пример #18
0
    def __init__(self):
        Baseline.__init__(self)

        self['creating_baseyear_cache_configuration'].tables_to_cache.append(
            'exogenous_relationships')
        self['creating_baseyear_cache_configuration'].tables_to_cache.append(
            'weather_exogenous')
        self['creating_baseyear_cache_configuration'].tables_to_cache.append(
            'consumption_re')
        self['creating_baseyear_cache_configuration'].tables_to_cache.append(
            'consumption_co')
        self['creating_baseyear_cache_configuration'].tables_to_cache.append(
            'consumption_mf')
        tables_to_copy_to_previous_years = self[
            'creating_baseyear_cache_configuration'].tables_to_copy_to_previous_years
        for table_name, year in tables_to_copy_to_previous_years.iteritems():
            tables_to_copy_to_previous_years[table_name] = 1995
        self['cache_directory'] = 'c:/urbansim_cache/water_test'
        self['dataset_pool_configuration'] = DatasetPoolConfiguration(
            package_order=['waterdemand', 'psrc', 'urbansim', 'opus_core'], )
        self[
            'scenario_database_configuration'].database_name = 'bellevue_consump_agg_month_year'
# 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)
Пример #20
0
          'hlcm': ['household_location_choice_model', 'psrc.estimation.psrc.estimation_HLCM_variables', None],
          'elcm-industrial': ['employment_location_choice_model', 'psrc.estimation.psrc.estimation_ELCM_variables', 'industrial'],
          'elcm-commercial': ['employment_location_choice_model', 'psrc.estimation.psrc.estimation_ELCM_variables', 'commercial'],
          'elcm-home_based': ['employment_location_choice_model', 'psrc.estimation.psrc.estimation_ELCM_variables', 'home_based'],
          'lpm': ['land_price_model', 'psrc.estimation.psrc.estimation_LPM_variables', None],
          'dplcm-industrial': ['development_project_location_choice_model', 'psrc.estimation.psrc.estimation_DPLCM_variables', 'industrial'],
          'dplcm-commercial': ['development_project_location_choice_model', 'psrc.estimation.psrc.estimation_DPLCM_variables', 'commercial'],
          'dplcm-residential': ['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=[])
Пример #21
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=[])