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


Python Action.instantiate_var方法代码示例

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


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

示例1: Schema

# 需要导入模块: from Action import Action [as 别名]
# 或者: from Action.Action import instantiate_var [as 别名]

#.........这里部分代码省略.........
				if not(post_props.has_key(c)):
					post_props[c] = o.coords.variable_coords[c]
		#print "All generalised prosp found:", post_props

		concrete_props = {}
		for o in most_reliable.state:
			ps = o.get_concrete_properties()
			for p in ps.keys():
				if not(concrete_props.has_key(p)):
					concrete_props[p] = ps[p]
			for c in o.coords.concrete_coords.keys():
				if not(concrete_props.has_key(c)):
					concrete_props[c] = o.coords.concrete_coords[c]
		#print "All concrete prosp found:", concrete_props

		for p in concrete_props.keys():
			if post_props.has_key(p) and "$" in str(post_props[p]):
				P = Pair(post_props[p],concrete_props[p])
				if not variables.has_key(p):
					variables[p]= P

		for k in variables.keys():
			#print "Variable to be changed:", k, str(variables[k])
			if "$" in str(variables[k].second):
				return

		for o in self.preconditions.state:
			#print "\[email protected]_var Props in preconditions Before: ", o.get_properties()
			ps = o.get_properties()
			for p in ps.keys():
				if variables.has_key(p):
					#if variables[p].first == ps[p]:
					#print "Sending for instatntiating:", p, variables[p].second
					o.instantiate_var(p, variables[p].second)
			cs = o.coords.get_coords()
			for c in cs.keys():
				#print "Coords in variable:",c, variables[c].second, variables[c].first, cs[c]
				if variables.has_key(c):
					if variables[c].first == cs[c]:
						o.instantiate_var(c, variables[c].second)
			#print "@set_var Props in preconditions After : ", o.props, o.coords.concrete_coords, o.get_properties(),o.coords.get_coords(),"\n"

		for o in self.associated_preconditions.state:
			#print "\[email protected]_var Props in associtaed preconditions Before: ", o.get_properties()
			ps = o.get_properties()
			for p in ps.keys():
				if variables.has_key(p):
					#if variables[p].first == ps[p]:
					#print "Sending for instatntiating:", p, variables[p].second
					o.instantiate_var(p, variables[p].second)
			cs = o.coords.get_coords()
			for c in cs.keys():
				#print "Coords in variable:",c, variables[c].second, variables[c].first, cs[c]
				if variables.has_key(c):
					if variables[c].first == cs[c]:
						o.instantiate_var(c, variables[c].second)
			#print "@set_var Props in associated preconditions After : ", o.props, o.coords.concrete_coords, o.get_properties(),o.coords.get_coords(),"\n"

		for o in self.postconditions.state:
			#print "\[email protected]_var Props in postconditions Before: ", o.get_properties(), o.coords.get_coords(), o.id
			ps = o.get_properties()
			for p in ps.keys():
				if variables.has_key(p):
					#if variables[p].first == ps[p]:
					o.instantiate_var(p, variables[p].second)
			cs = o.coords.get_coords()
开发者ID:kumar54,项目名称:Dev-PSchema,代码行数:70,代码来源:Schema.py


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