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