本文整理汇总了Python中task.Task.logical_regions_created方法的典型用法代码示例。如果您正苦于以下问题:Python Task.logical_regions_created方法的具体用法?Python Task.logical_regions_created怎么用?Python Task.logical_regions_created使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task.Task
的用法示例。
在下文中一共展示了Task.logical_regions_created方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: random_task
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import logical_regions_created [as 别名]
def random_task(regions, settings, depth):
name = next_name('task')
rrs = random_region_requirements_no_alias(regions, settings)
t = Task(name, rrs)
t.logical_regions_created = random_logical_region_trees(t.name, settings)
child_tasks = random_tasks(t.logical_regions_created, settings, depth+1)
t.child_tasks = child_tasks
return t
示例2: random_task
# 需要导入模块: from task import Task [as 别名]
# 或者: from task.Task import logical_regions_created [as 别名]
def random_task(regions, settings, depth, parent_rrs=[], parent_name=None):
name = next_name( 'task' )
region_requirements = random_region_requirements_no_alias(regions, settings)
region_requirements += random_region_requirements_from_rrs_no_alias(parent_rrs, settings)
# if parent_rrs:
# region_requirements += parent_rrs
# num_region_requirements_to_pass_on = int(len(region_requirements) * 0.5)
# region_requirements = sample(region_requirements, num_region_requirements_to_pass_on)
# Create task
t = Task(name, region_requirements, parent_rrs)
created_regions = random_logical_region_trees(t.name, settings)
t.logical_regions_created = created_regions
child_tasks = random_tasks(created_regions,
settings, depth+1,
parent_rrs=region_requirements,
parent_name=name)
t.child_tasks = child_tasks
return t