Changeset 3304 for trunk/inprocess/bhylee/hlcm_parcel_estimation.py
- Timestamp:
- 05/05/08 14:18:27 (4 months ago)
- Files:
-
- 1 modified
-
trunk/inprocess/bhylee/hlcm_parcel_estimation.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inprocess/bhylee/hlcm_parcel_estimation.py
r3112 r3304 14 14 15 15 from urbansim.configs.hlcm_estimation_config import HLCMEstimationConfig 16 from psrc_parcel.configs.baseline_estimation import BaselineEstimation 16 17 from opus_core.session_configuration import SessionConfiguration 17 18 from opus_core.store.attribute_cache import AttributeCache 18 19 from my_estimation_config import my_configuration 19 20 20 class HlcmParcelEstimation(HLCMEstimationConfig): 21 class HlcmParcelEstimation(BaselineEstimation): # comment out for urbansim.configs.hlcm_estimation_config 22 #class HlcmParcelEstimation(HLCMEstimationConfig): # comment out for psrc_parcel.configs.baseline_estimation 21 23 def update_config(self): 22 HLCMEstimationConfig.update_config(self) 24 # HLCMEstimationConfig.update_config(self) # comment out for psrc_parcel.configs.baseline_estimation 23 25 # 24 26 self.replace(my_configuration) 25 27 estimate_config = {} 26 estimate_config["export_estimation_data"]=False27 estimate_config["estimation_data_file_name"]="/tmp/HLCM_building_estimate_data"28 estimate_config["use_biogeme_data_format"]=True29 estimate_config["weights_for_estimation_string"]= "has_eg_1_units=building.residential_units>=1" #"psrc.parcel.residential_units_when_has_eg_1_surveyed_households_and_is_in_county_033"28 # estimate_config["export_estimation_data"]=False 29 # estimate_config["estimation_data_file_name"]="/tmp/HLCM_building_estimate_data" 30 # estimate_config["use_biogeme_data_format"]=True 31 # estimate_config["weights_for_estimation_string"]= "has_eg_1_units=building.residential_units>=1" #"psrc.parcel.residential_units_when_has_eg_1_surveyed_households_and_is_in_county_033" 30 32 #"sampling_filter=(building.disaggregate(building_type.building_type_name)=='single_family_residential') + (building.disaggregate(building_type.building_type_name)=='multi_family_residential') + (building.disaggregate(building_type.building_type_name)=='condo_residential')" 31 33 #"has_eg_1_units=urbansim.building.residential_units>=1" 32 34 33 estimate_config["stratum"] = "psrc.parcel.is_in_city_seattle" #"psrc.parcel.stratify_by_is_in_city_seattle_and_is_single_family_unit" 34 estimate_config["sample_size_from_each_stratum"] = 5 35 estimate_config["sample_size_from_chosen_stratum"] = 4 36 estimate_config["include_chosen_choice"] = True 35 # estimate_config["stratum"] = "psrc.parcel.is_in_city_seattle" #"psrc.parcel.stratify_by_is_in_city_seattle_and_is_single_family_unit" 36 # estimate_config["sample_size_from_each_stratum"] = 5 37 # estimate_config["sample_size_from_chosen_stratum"] = 4 38 # estimate_config["include_chosen_choice"] = True 39 estimate_config['wesml_sampling_correction_variable'] = 'psrc_parcel.building.wesml_sampling_correction_variable' 37 40 #estimate_config['submodel_string'] = "None" 38 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['sample_size_locations'] = 3041 # self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['sample_size_locations'] = 30 39 42 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['sampler']="'opus_core.samplers.weighted_sampler'"#"'opus_core.samplers.stratified_sampler'" # 40 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["estimate_config"]= \ 41 estimate_config 43 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["estimate_config"] = estimate_config 44 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["estimation_weight_string"] = "'has_eg_1_units=building.residential_units>=1'" 45 # self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["estimation_weight_string"] = "'urbansim_parcel.building.vacant_residential_units'" 46 # self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["estimation_weight_string"] = "'psrc_parcel.building.residential_units'" 42 47 #{"weights_for_estimation_string":"psrc.parcel.residential_units_when_has_eg_1_surveyed_households_and_is_in_county_033"} 43 48 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["location_set"] = "building" 44 49 #self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["location_id_string"] = "'household.parcel_id'" 45 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['submodel_string'] = "'psrc.household.number_of_nonhome_based_workers'" 46 50 # self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['submodel_string'] = "'psrc.household.number_of_nonhome_based_workers'" 51 52 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["variable_package"]="'urbansim_parcel'" 53 47 54 self["models_configuration"]["household_location_choice_model"]["controller"]["prepare_for_estimate"]["arguments"]["join_datasets"] = 'True' 48 55 self["models_configuration"]["household_location_choice_model"]["controller"]["prepare_for_estimate"]["arguments"]["index_to_unplace"] = 'None' 49 self["models_configuration"]["household_location_choice_model"]["controller"]["prepare_for_estimate"]["arguments"]["filter"] = None #"'psrc.household.customized_filter'" 56 self["models_configuration"]["household_location_choice_model"]["controller"]["prepare_for_estimate"]["arguments"]["filter"] = "'household.move == 1'"#None #"'psrc.household.customized_filter'" 57 self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['filter'] = None 50 58 51 59 self["models"] = [ 52 #{"household_relocation_model": ["run"]},60 # {"household_relocation_model": ["run"]}, 53 61 {"household_location_choice_model": ["estimate"]} 54 62 ] … … 66 74 run_configuration, "household_location_choice_model", 67 75 "inprocess.bhylee.hlcm_parcel_specification") 68 run_configuration.replace(my_configuration)69 76 er = Estimator(run_configuration, save_estimation_results=False) 70 77 71 78 er.estimate() 79 er.create_prediction_success_table() 80 er.create_prediction_success_table(choice_geography_id="area_type_id=building.disaggregate(zone.area_type_id, intermediates=[parcel])" ) 81 er.create_prediction_success_table(choice_geography_id="building_type_id=building.building_type_id" ) 82 # er.create_prediction_success_table(choice_geography_id="large_area_id=building.disaggregate(faz.large_area_id, intermediates=[zone, parcel])" ) 72 83 # er.reestimate("hlcm_parcel_specification")
