本文整理汇总了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()