def init_task_list_order_pos(self): # 任务排序初始化 task_list_ordered = self.workflow.task_list # 任务位置初始化 individual_task_list = list() for task in task_list_ordered: individual_task = IndividualTask() individual_task.task = task individual_task.exec_pos = 10 individual_task_list.append(individual_task) return individual_task_list
def init_task_list_order_pos(self): # 任务排序初始化 task_list_ordered = self.workflow.task_list # 任务位置初始化 individual_task_list = list() for task in task_list_ordered: individual_task = IndividualTask() individual_task.task = task random_num = random.randrange(0, 150) individual_task.exec_pos = int(random_num / 10) individual_task_list.append(individual_task) return individual_task_list
def init_task_list_order_pos(self): # 任务排序初始化 task_list_ordered = self.workflow.init_task_order() # 任务位置初始化 individual_task_list = list() index = 0 for task_id in task_list_ordered: task = self.workflow.get_task_by_id(task_id) individual_task = IndividualTask() individual_task.task = task individual_task.exec_sequence = index # 执行位置初始化为0,代表在移动设备上 individual_task.exec_pos = 0 individual_task_list.append(individual_task) index += 1 return individual_task_list
def init_task_list_order_pos(self): # 任务排序初始化 task_list_ordered = self.workflow.init_task_order() # 任务位置初始化 individual_task_list = list() index = 0 for task_id in task_list_ordered: task = self.workflow.get_task_by_id(task_id) individual_task = IndividualTask() individual_task.task = task individual_task.exec_sequence = index random_num = random.random() if random_num <= 0.5: individual_task.exec_pos = 0 else: individual_task.exec_pos = 1 individual_task_list.append(individual_task) index += 1 return individual_task_list