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


Python Action.name方法代码示例

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


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

示例1: bootstrap

# 需要导入模块: from Action import Action [as 别名]
# 或者: from Action.Action import name [as 别名]
	def bootstrap(self, caller=None):
		"""Perform all basic reaches and other actions
		(grasps, presses, observes, etc.) to provide the
		schema memory with the lowest level set of actions."""
		#status = self.memory.update_world_state(self.get_sensors())
		print "Bootstrap Update state"
		for y in range(0,7):#7
			for x in range(0, 9):#9
				if (x>1 and x<7 and y>0 and y<6):
					reach = Action()
					reach.name = "reach"
					reach.props["x"] = float(x)
					reach.props["y"] = float(y)
					reach.connect("abstract_signal", self.abstract_action)
					self.bootstrap_action(reach)
				saccade = Action()
				saccade.name = "saccade"
				saccade.props["x"] = float(x)
				saccade.props["y"] = float(y)
				#saccade.connect("abstract_signal", self.abstract_action)
				#self.bootstrap_action(saccade)
		grasp = Action()
		grasp.name = "grasp"
		grasp.connect("abstract_signal", self.abstract_action)
		#self.bootstrap_action(grasp)
		release = Action()
		release.name = "release"
		release.connect("abstract_signal", self.abstract_action)
		#self.bootstrap_action(release)
		press = Action()
		press.name = "press"
		press.connect("abstract_signal", self.abstract_action)
开发者ID:kumar54,项目名称:Dev-PSchema,代码行数:34,代码来源:Controller.py

示例2: build_action

# 需要导入模块: from Action import Action [as 别名]
# 或者: from Action.Action import name [as 别名]
	def build_action(self, response):
		i = 0; A = None
		while i <response.size():
			if response.get(i).asString() == "Action":
				if A != None:
					A.connect("abstract_signal", self.abstract_action)
					self.bootstrap_action(A); A = None
				A =  Action()
				A.name = response.get(i+1).asString()
				i +=2; continue
			else:
				p = response.get(i).asString()
				try:
					ps = response.get(i+1).asDouble()
				except:
					try:
						ps = response.get(i+1).asInt()
					except:
						ps = response.get(i+1).asString()

				if type(ps)==type(str()) and ps[0] == "$":
					A.props_var[p] = response.get(i+1).asString()
					A.props[p] = None
				else:
					A.props[p] = ps; A.props_var[p] = None
				i +=2; continue
		A.connect("abstract_signal", self.abstract_action)
		self.bootstrap_action(A)
开发者ID:kumar54,项目名称:Dev-PSchema,代码行数:30,代码来源:Controller.py


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