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


Python SessionConfiguration.get_dataset_from_pool方法代码示例

本文整理汇总了Python中opus_core.session_configuration.SessionConfiguration.get_dataset_from_pool方法的典型用法代码示例。如果您正苦于以下问题:Python SessionConfiguration.get_dataset_from_pool方法的具体用法?Python SessionConfiguration.get_dataset_from_pool怎么用?Python SessionConfiguration.get_dataset_from_pool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在opus_core.session_configuration.SessionConfiguration的用法示例。


在下文中一共展示了SessionConfiguration.get_dataset_from_pool方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: prepare_data_before_baseyear

# 需要导入模块: from opus_core.session_configuration import SessionConfiguration [as 别名]
# 或者: from opus_core.session_configuration.SessionConfiguration import get_dataset_from_pool [as 别名]
  def prepare_data_before_baseyear(self, 
                                   cache_directory, 
                                   base_year,
                                   creating_baseyear_cache_configuration):
      if creating_baseyear_cache_configuration.unroll_gridcells:
          sc = SessionConfiguration()
          gridcells = sc.get_dataset_from_pool('gridcell')
          development_event_history = sc.get_dataset_from_pool('development_event_history')
      
          UnrollGridcells().unroll_gridcells_to_cache(gridcells, development_event_history,
                                                      cache_directory, base_year)
          # If you want to unroll the gridcells using your buildings table, exchange the 
          # previous two calls by the two following ones.
          #buildings = sc.get_dataset_from_pool('building')
          #UnrollGridcells().unroll_gridcells_to_cache_from_buildings(gridcells, buildings,
          #                                            cache_directory, base_year)
 
      attribute_cache = AttributeCache()
      self._initialize_previous_years(attribute_cache, base_year,
                                      creating_baseyear_cache_configuration)
开发者ID:christianurich,项目名称:VIBe2UrbanSim,代码行数:22,代码来源:cache_scenario_database.py

示例2: AttributeCache

# 需要导入模块: from opus_core.session_configuration import SessionConfiguration [as 别名]
# 或者: from opus_core.session_configuration.SessionConfiguration import get_dataset_from_pool [as 别名]
                              save_estimation_results=False)
    estimator.simulation_state.set_current_time(2000)
    
    attribute_cache = AttributeCache()
    sc = SessionConfiguration()
    CLOSE = 0.005   #criterion for convergence
    sc.put_data({'CLOSE':CLOSE, 'info_file':info_file})
    
    seed(71) # was: seed(71,110)

    ## relocate movers
    from urbansim.models.household_relocation_model_creator import HouseholdRelocationModelCreator
    hrm = HouseholdRelocationModelCreator().get_model(probabilities='urbansim.household_relocation_probabilities',
                                                      location_id_name='building_id' )
    hrm_resources = hrm.prepare_for_run(rate_storage=attribute_cache,
                                        rate_table='annual_relocation_rates_for_households',
                                        what='households')
    hrm_index = hrm.run(agent_set=sc.get_dataset_from_pool('household'),
                        resources=hrm_resources)
    
    estimator.estimate(spec_py=hlcm_specification, 
                       movers_index=hrm_index, 
                       submarket_definition=(options.submarket_geography, options.submarket_attribute),
                       alt_sample_size=alt_sample_size,
                       sampler=sampler,
                       weight_string = options.weight_string,
                       aggregate_demand=options.aggregate_demand,
                       sample_size_from_each_stratum = int(options.sample_size_from_each_stratum),
                   )

开发者ID:christianurich,项目名称:VIBe2UrbanSim,代码行数:31,代码来源:estimation_HLCM_with_price.py


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