artificial-intelligence - AgentSpeak : Problems at sending plan (Jason)

标签 artificial-intelligence agent

我正在尝试通过以下方式将计划从 Agent1 发送到 Agent2:

@c2[atomic] 
+giveRule[source(A)]: planGiven(B) <-
                -+planGiven(B+1);
                .send(A, tellHow, "@s1 +sum(num1(X, Y), num2(A, B))[source(S)] :logic(L) & attentiveness(T)<- if ((L + T) > 2){ -+res(num1(X, Y), num2(A, B), res(X*10 + A*10 + Y + B)); .send(S, tell, result(X*10 + A*10 + Y + B)); } else { -+res(num1(X, Y), num2(A, B), res(X + A + Y + B)); .send(S, tell, result(X + A + Y + B)); }.");
                -+stopGivingPlan.

然后,我试图通过从 Agent1 向 Agent2 发送消息来使这个计划生效:

@c3[atomic]
+giveProbs[source(A)]: probsGiven(B) & stud(A,X)<-
                -+probsGiven(B+1);
                .send(A, tell, sum(num1(3,3), num2(4,9))).

这是行不通的。 为什么?

还有重要的补充: 如果我不发送计划,只是将其复制到 Agent2 中,它就可以正常工作。所以语法没问题。

另外,我在 eclipse 中使用了 jason 插件,如果值得一提的话。

最佳答案

不太清楚正在执行什么,如果你能展示整个代码就更好了。我简化了案例只是为了展示一个总体思路,如下所示:

代理1代码:

!start.

+!start: true <-
    .send(agent2, tellHow, "@s1 +!sum(num1(X, Y), num2(A, B))[source(S)] :true <-  -+res(num1(X, Y), num2(A, B), res(X + A + Y + B)); ?res(Z1,Z2,Z3); .print(Z1,\"+\",Z2,\"=\",Z3).");  
    .send(agent2, achieve, sum(num1(1,2), num2(3,4))).

代理2代码:

/* No previous code - agent1 will send a plan*/

响应应该是:

[agent2] num1(1,2)+num2(3,4)=res(10)

在这种情况下,agent2 在 agent1 发送计划之前无事可做。 Agent1 也在发送一个触发计划来实现一个总和。

关于artificial-intelligence - AgentSpeak : Problems at sending plan (Jason),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28223993/

相关文章:

java - 未加载内部操作错误 : java. lang.ClassNotFoundException

haskell - 如何在 Haskell 中创建两个具有内部状态的相互生产者/消费者?

artificial-intelligence - 是否可以使用 API 让 microsoft LUIS 自动训练?

python - 如何构建一个人工智能系统,该系统可以从语料库中学习并在用户询问与该语料库相关的任何问题时回答用户

selenium - 将 Selenium 测试与 tfs 集成

map - 最佳寻路

email - 是否可以制作一个相应回复的电子邮件机器人?

php - 使用 PHP 创建 A* 搜索

machine-learning - 将公用事业分配给本地各州时,难以指定长期观点

java - OpenAM 代理的配置