本文整理汇总了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)