Skip to content

Commit

Permalink
small fixes here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
peschue committed May 28, 2018
1 parent eae2394 commit 26b9024
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions acthex/actionmanager.py
Expand Up @@ -25,8 +25,8 @@ def extractActions(model):
def parseAction(a):
assert(isinstance(a, dlvhex.ID))
atuple = a.tuple()
aname, aprio = atuple[0].value(), atuple[2].intValue()
aargs = atuple[1].tuple()[1:]
logging.debug("parseAction on tuple "+repr(atuple))
aname, aargs, aprio = atuple[0].value(), atuple[1].tuple()[1:], atuple[2].intValue()
aname = aname[len(aux.Aux.ACTREPL)+1:]
logging.debug("from ID={} extracted name={} args={} prio={}".format(repr(a), repr(aname), repr(aargs), repr(aprio)))
return ActionToBeExecuted(aname, aargs, aprio)
Expand Down
3 changes: 3 additions & 0 deletions acthex/rewriter.py
Expand Up @@ -67,6 +67,9 @@ def __rewriteHead(self, candidate):
if len(modifiers) > 1 and any([x for x in modifiers if hexlite.flatten(x)[0] in ['b','c','p']]):
raise Exception("action modifiers: only priority implemented: "+shp.shallowprint(candidate))
actAuxArgs += modifiers
else:
# default priority modifier = {0}
actAuxArgs += [0]
relAuxAtom = [ actAuxPred, actAuxArgs ]
if __debug__:
logging.debug('rH action replacement head='+pprint.pformat(relAuxAtom, width=1000))
Expand Down
2 changes: 1 addition & 1 deletion bin/acthex
Expand Up @@ -138,7 +138,7 @@ def main():
# find and execute actions on environment
acthex.actionmanager.executeActions(callback.optimal_model)
except acthex.IterationExit:
logging.info("got acthex iteration exist exception")
logging.info("got acthex iteration exit exception")
except SystemExit:
pass
except:
Expand Down

0 comments on commit 26b9024

Please sign in to comment.