本文整理汇总了Python中Robot.Robot.show_tree_graph方法的典型用法代码示例。如果您正苦于以下问题:Python Robot.show_tree_graph方法的具体用法?Python Robot.show_tree_graph怎么用?Python Robot.show_tree_graph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Robot.Robot
的用法示例。
在下文中一共展示了Robot.show_tree_graph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Window
# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import show_tree_graph [as 别名]
#.........这里部分代码省略.........
aSearchValueDialog = DialogASearchValues()
aSearchValueDialog.show_request_message(message)
numerator = aSearchValueDialog.get_numerator()
denominator = aSearchValueDialog.get_denominator()
self.robot = Robot(self,self.environment,self.dimension,self.queue_dimension,"A*h2",option_response,numerator,denominator)
if option_response:
self.labelSelectedSearch.setText("A* Manhattan Distance avoiding cycles")
else:
self.labelSelectedSearch.setText("A* Manhattan Distance with cycles")
self.draw_environment()
self.plainTextEditRobotStatus.appendPlainText("Ready .......")
self.pushButtonMoveRobot.setEnabled(False)
self.pushButtonLookGraph.setEnabled(True)
self.pushButtonFastSearch.setEnabled(True)
self.pushButtonNextStep.setEnabled(True)
def select_a_rect_distance_search(self):
self.load_environment()
self.clear_components()
self.optionDialog = DialogOption()
self.optionDialog.display_option_message("Do you want avoid cycles")
option_response = self.optionDialog.get_taken_option()
message = "Please specify the numerator and denominator to complement the heuristic method"
aSearchValueDialog = DialogASearchValues()
aSearchValueDialog.show_request_message(message)
numerator = aSearchValueDialog.get_numerator()
denominator = aSearchValueDialog.get_denominator()
self.robot = Robot(self,self.environment,self.dimension,self.queue_dimension,"A*h1",option_response,numerator,denominator)
if option_response:
self.labelSelectedSearch.setText("A* Straight Line Distance avoiding cycles")
else:
self.labelSelectedSearch.setText("A* Straight Line Distance with cycles")
self.draw_environment()
self.plainTextEditRobotStatus.appendPlainText("Ready .......")
self.pushButtonMoveRobot.setEnabled(False)
self.pushButtonLookGraph.setEnabled(True)
self.pushButtonFastSearch.setEnabled(True)
self.pushButtonNextStep.setEnabled(True)
def fast_search(self):
result = 3
while result == 3:
result = self.step_search()
return result
def step_search(self):
result = self.robot.iterative_step()
if result == 1:
self.pushButtonFastSearch.setEnabled(False)
self.pushButtonNextStep.setEnabled(False)
self.pushButtonMoveRobot.setEnabled(True)
elif result == 2:
self.pushButtonFastSearch.setEnabled(False)
self.pushButtonNextStep.setEnabled(False)
return result
def move_robot(self):
self.robot.move_one_step()
self.draw_environment()
def look_graph(self):
self.robot.show_tree_graph()
def printRobotMassage(self,massage):
self.plainTextEditRobotStatus.appendPlainText(massage)
def display_environment_editor(self):
editor = DialogEnvironmentEditor(self)
editor.exec_()
def update_from_search_node(self,data):
self.lineEditState.setText(str(data[0]))
self.lineEditParent.setText(str(data[1]))
self.lineEditAction.setText(str(data[2]))
self.lineEditCost.setText(str(data[3]))
self.lineEditDepth.setText(str(data[4]))
self.lineEditH.setText(str(data[5]))
self.lineEditG.setText(str(data[6]))
def update_from_search_queue(self,data):
self.plainTextEditDataStatus.appendPlainText(str(data))
def update_from_robot(self,data):
self.plainTextEditRobotStatus.appendPlainText(str(data))