当前位置: 首页>>代码示例>>Python>>正文


Python Robot.move_one_step方法代码示例

本文整理汇总了Python中Robot.Robot.move_one_step方法的典型用法代码示例。如果您正苦于以下问题:Python Robot.move_one_step方法的具体用法?Python Robot.move_one_step怎么用?Python Robot.move_one_step使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Robot.Robot的用法示例。


在下文中一共展示了Robot.move_one_step方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Window

# 需要导入模块: from Robot import Robot [as 别名]
# 或者: from Robot.Robot import move_one_step [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))
开发者ID:DonAurelio,项目名称:Artificial_Intelligence_proyect,代码行数:104,代码来源:Window.py


注:本文中的Robot.Robot.move_one_step方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。