def run_estimation(self, estimation_config, model_name, save_estimation_results=True):
     config = Baseline()
     config.merge(estimation_config)
     config['config_changes_for_estimation'] = ConfigChangesForEstimation()
     logger.start_block('Estimating %s' % model_name)
     try:
         estimator = UrbansimEstimationRunner(
             models[model_name][0], 
             specification_module=models[model_name][1], model_group=models[model_name][2],
             configuration=config,
             save_estimation_results=save_estimation_results
             )
         estimator.estimate()
         
     finally:
         logger.end_block()
Beispiel #2
0
    def run_estimation(self,
                       estimation_config,
                       model_name,
                       save_estimation_results=True):
        config = Baseline()
        config.merge(estimation_config)
        config['config_changes_for_estimation'] = ConfigChangesForEstimation()
        logger.start_block('Estimating %s' % model_name)
        try:
            estimator = UrbansimEstimationRunner(
                models[model_name][0],
                specification_module=models[model_name][1],
                model_group=models[model_name][2],
                configuration=config,
                save_estimation_results=save_estimation_results)
            estimator.estimate()

        finally:
            logger.end_block()
Beispiel #3
0
 def setUp(self):
     self.temp_dir = tempfile.mkdtemp(prefix='opus_tmp')
     self.simulation = RunSimulationFromMysql()
     run_configuration = Baseline()
     run_configuration[
         'creating_baseyear_cache_configuration'].cache_directory_root = self.temp_dir
     run_configuration[
         'creating_baseyear_cache_configuration'].tables_to_cache = [
             "development_events"
         ]
     run_configuration[
         'scenario_database_configuration'].database_name = "washtenaw_class"
     run_configuration[
         'seed'] = 1,  #(1,1)  # always start with same random seed
     self.simulation.prepare_for_simulation(run_configuration)
     self.completed_without_error = False
    "dplcm-residential": [
        "development_project_location_choice_model",
        "washtenaw.estimation.DPLCM_specification",
        "residential",
    ],
    "rlsm": ["residential_land_share_model", "washtenaw.estimation.RLSM_specification", None],
}

model = "hlcm"
# model = 'elcm-industrial'
# model = 'elcm-commercial'
# model = 'elcm-homebased'
# 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=False,
)
estimator.estimate()
# estimator.reestimate()
Beispiel #5
0
models = {
          'hlcm': ['household_location_choice_model', 'washtenaw.estimation.HLCM_specification', None],
          'elcm-industrial': ['employment_location_choice_model', 'washtenaw.estimation.ELCM_specification', 'industrial'],
          'elcm-commercial': ['employment_location_choice_model', 'washtenaw.estimation.ELCM_specification', 'commercial'],
          'elcm-home_based': ['employment_location_choice_model', 'washtenaw.estimation.ELCM_specification', 'home_based'],
          'lpm': ['land_price_model', 'washtenaw.estimation.LPM_specification', None],
          'dplcm-industrial': ['development_project_location_choice_model', 'washtenaw.estimation.DPLCM_specification', 'industrial'],
          'dplcm-commercial': ['development_project_location_choice_model', 'washtenaw.estimation.DPLCM_specification', 'commercial'],
          'dplcm-residential': ['development_project_location_choice_model', 'washtenaw.estimation.DPLCM_specification', 'residential'],
          'rlsm': ['residential_land_share_model', 'washtenaw.estimation.RLSM_specification', None],
          }

model = 'hlcm'
#model = 'elcm-industrial'
#model = 'elcm-commercial'
#model = 'elcm-homebased'
#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=False)
estimator.estimate()
#estimator.reestimate()
Beispiel #6
0
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE

from washtenaw.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
the baseline washtenaw configuration.
"""

run_configuration = Baseline()

from_database_configuration = ScenarioDatabaseConfiguration(database_name = 'wastenaw_baseyear')
to_database_configuration = ScenarioDatabaseConfiguration(database_name = 'washtenaw_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)