當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。