agents_psrc.summary() dbcon = [] config = ScenarioDatabaseConfiguration() server = DatabaseServer(config) db = server.get_database('PSRC_2000_baseyear') storage = StorageFactory().get_storage('sql_storage', storage_location=db) coefficients = Coefficients(in_storage=storage) coefficients.load(in_table_name="household_location_choice_model_coefficients") specification = EquationSpecification(in_storage=storage) specification.load( in_table_name="household_location_choice_model_specification") specification.get_variable_names() hlcm_psrc = HouseholdLocationChoiceModelCreator().get_model( location_set=locations_psrc, sampler="opus_core.samplers.weighted_sampler", sample_size_locations=10, choices="urbansim.lottery_choices", compute_capacity_flag=True, run_config=Resources( {"capacity_string": "urbansim.gridcell.vacant_residential_units"})) result = hlcm_psrc.run(specification, coefficients, agents_psrc, agents_index=sample(range(agents_psrc.size()), 500), debuglevel=4)
dbcon = [] config = ScenarioDatabaseConfiguration() server = DatabaseServer(config) db = server.get_database('PSRC_2000_baseyear') storage = StorageFactory().get_storage( 'sql_storage', storage_location = db) coefficients = Coefficients(in_storage=storage) coefficients.load(in_table_name="household_location_choice_model_coefficients") specification = EquationSpecification(in_storage=storage) specification.load(in_table_name="household_location_choice_model_specification") specification.get_variable_names() hlcm_psrc = HouseholdLocationChoiceModelCreator().get_model( location_set = locations_psrc, sampler = "opus_core.samplers.weighted_sampler", sample_size_locations=10, choices="urbansim.lottery_choices", compute_capacity_flag=True, run_config=Resources({"capacity_string":"urbansim.gridcell.vacant_residential_units"})) result = hlcm_psrc.run(specification, coefficients, agents_psrc, agents_index=sample(range(agents_psrc.size()), 500), debuglevel=4) # run it again