def replan(self, temporary_task_): new_run = improve_plan_given_history(self.product, self.trace, self.run, self.index) if new_run: self.run = new_run self.index = 0 self.segment = 'line' self.trace = [] self.run_history = [] if (len(temporary_task_.combinations)) > 0: current_state = list( initial_state_given_history(self.product, self.run_history, self.run, self.index)) current_state = current_state[0] run_temp = temporary_task_.find_temporary_run( current_state, self.product) end_temporary = set() end_temporary.add(run_temp.prefix[-1]) new_run, time = dijkstra_plan_optimal(self.product, 10, end_temporary) prefix = run_temp.prefix[0:-1] + new_run.prefix precost = run_temp.precost + new_run.precost suffix = run_temp.suffix + new_run.suffix sufcost = new_run.sufcost totalcost = precost + self.beta * sufcost self.run = ProdAut_Run(self.product, prefix, precost, suffix, sufcost, totalcost)
def replan(self): new_run = improve_plan_given_history(self.product, self.trace) if (new_run) and (new_run.pre_plan !=self.run.pre_plan[self.index:-1]): self.run = new_run self.index = 1 self.segment = 'line' self.next_move = self.run.pre_plan[self.index] print 'Plan adapted!'
def replan(self): new_run = improve_plan_given_history(self.product, self.trace) if (new_run) and (new_run.pre_plan !=self.run.pre_plan[self.index:-1]): self.run = new_run self.index = 1 self.segment = 'line' self.next_move = self.run.pre_plan[self.index] print 'Plan adapted!'
def replan(self): self.run = improve_plan_given_history(self.product, self.trace) self.index = 0 self.segment = 'line' self.next_move = self.run.pre_plan[self.index]