本文整理匯總了Python中urbansim.datasets.household_dataset.HouseholdDataset.compute_variables方法的典型用法代碼示例。如果您正苦於以下問題:Python HouseholdDataset.compute_variables方法的具體用法?Python HouseholdDataset.compute_variables怎麽用?Python HouseholdDataset.compute_variables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類urbansim.datasets.household_dataset.HouseholdDataset
的用法示例。
在下文中一共展示了HouseholdDataset.compute_variables方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ZoneDataset
# 需要導入模塊: from urbansim.datasets.household_dataset import HouseholdDataset [as 別名]
# 或者: from urbansim.datasets.household_dataset.HouseholdDataset import compute_variables [as 別名]
zones_psrc = ZoneDataset(in_storage = storage)
hlcm_psrc_zones = HouseholdLocationChoiceModelCreator().get_model(
location_set = zones_psrc,
sampler = "opus_core.samplers.weighted_sampler",
sample_size_locations=10,
choices="opus_core.random_choices_from_index",
compute_capacity_flag=False,
estimate_config=Resources({"weights_for_estimation_string":None}))
specification = EquationSpecification(variables=(
"urbansim.zone.number_of_jobs",
"urbansim.household.income"),
coefficients=(
"NOJ", "INC"))
agents_psrc.compute_variables(["urbansim.household.zone_id"],
resources=Resources({"gridcell":locations_psrc}))
jobs_psrc = JobDataset(in_storage = StorageFactory().get_storage('flt_storage',
storage_location = "/home/hana/urbansim/data/GPSRC"),
in_table_name = "jobs")
coef, result = hlcm_psrc_zones.estimate(specification, agents_psrc,
agents_index=idx,
estimate_config=Resources({"estimation_size_agents":0.01}),
data_objects={"job":jobs_psrc, "gridcell":locations_psrc},
debuglevel=4)
result = hlcm_psrc_zones.run(specification, coef, agents_psrc,
agents_index=array(sample(range(agents_psrc.size()), 500)),
data_objects={"job":jobs_psrc, "gridcell":locations_psrc},
debuglevel=4)