Commit 013d3b92 by serfrape

Allow receival of predicates without args (values)

parent 00928232
......@@ -10,6 +10,7 @@ from spade.agent import Agent
from spade.template import Template
from spade.message import Message
import json
from ast import literal_eval
PERCEPT_TAG = frozenset(
[pyson.Literal("source", (pyson.Literal("percept"), ))])
......@@ -180,8 +181,13 @@ class BDIAgent(Agent):
raise pyson.PysonError(
"unknown illocutionary force: %s" % ilf_type)
intention = pyson.runtime.Intention()
args = literal_eval(received["args"])
if args != tuple():
message = pyson.Literal(
received["functor"], tuple([received["args"]]))
received["functor"], args)
else:
message = pyson.Literal(received["functor"])
message = pyson.freeze(message, intention.scope, {})
tagged_message = message.with_annotation(
pyson.Literal("source", (pyson.Literal(str(msg.sender)), )))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment