Show
Ignore:
Timestamp:
05/05/08 14:18:27 (4 months ago)
Author:
bhylee
Message:

(bhylee) updated files

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/inprocess/bhylee/hlcm_parcel_estimation.py

    r3112 r3304  
    1414 
    1515from urbansim.configs.hlcm_estimation_config import HLCMEstimationConfig 
     16from psrc_parcel.configs.baseline_estimation import BaselineEstimation 
    1617from opus_core.session_configuration import SessionConfiguration 
    1718from opus_core.store.attribute_cache import AttributeCache 
    1819from my_estimation_config import my_configuration 
    1920 
    20 class HlcmParcelEstimation(HLCMEstimationConfig): 
     21class HlcmParcelEstimation(BaselineEstimation): # comment out for urbansim.configs.hlcm_estimation_config 
     22#class HlcmParcelEstimation(HLCMEstimationConfig): # comment out for psrc_parcel.configs.baseline_estimation 
    2123    def update_config(self): 
    22         HLCMEstimationConfig.update_config(self) 
     24#        HLCMEstimationConfig.update_config(self) # comment out for psrc_parcel.configs.baseline_estimation 
    2325#         
    2426        self.replace(my_configuration) 
    2527        estimate_config = {} 
    26         estimate_config["export_estimation_data"]=False 
    27         estimate_config["estimation_data_file_name"]="/tmp/HLCM_building_estimate_data" 
    28         estimate_config["use_biogeme_data_format"]=True 
    29         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" 
    3032        #"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')" 
    3133        #"has_eg_1_units=urbansim.building.residential_units>=1" 
    3234             
    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' 
    3740        #estimate_config['submodel_string'] = "None" 
    38         self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['sample_size_locations'] = 30 
     41#        self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]['sample_size_locations'] = 30 
    3942        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'" 
    4247                           #{"weights_for_estimation_string":"psrc.parcel.residential_units_when_has_eg_1_surveyed_households_and_is_in_county_033"} 
    4348        self["models_configuration"]["household_location_choice_model"]["controller"]["init"]["arguments"]["location_set"] = "building" 
    4449        #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 
    4754        self["models_configuration"]["household_location_choice_model"]["controller"]["prepare_for_estimate"]["arguments"]["join_datasets"] = 'True' 
    4855        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 
    5058         
    5159        self["models"] = [ 
    52         #    {"household_relocation_model": ["run"]}, 
     60#            {"household_relocation_model": ["run"]}, 
    5361            {"household_location_choice_model": ["estimate"]} 
    5462        ] 
     
    6674                            run_configuration, "household_location_choice_model", 
    6775                            "inprocess.bhylee.hlcm_parcel_specification") 
    68     run_configuration.replace(my_configuration) 
    6976    er = Estimator(run_configuration, save_estimation_results=False) 
    7077     
    7178    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])" ) 
    7283#    er.reestimate("hlcm_parcel_specification")