当前位置: 首页>>代码示例>>Python>>正文


Python HouseholdDataset.compute_variables方法代码示例

本文整理汇总了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)
开发者ID:christianurich,项目名称:VIBe2UrbanSim,代码行数:32,代码来源:demo.py


注:本文中的urbansim.datasets.household_dataset.HouseholdDataset.compute_variables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。