【发布时间】:2015-03-29 05:26:12
【问题描述】:
我正在尝试通过以下方式从 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 插件,如果这值得一提的话。
【问题讨论】:
-
要么我方式落后于时代,要么那不是Java。那么......它是什么?
-
抱歉,标签不足。是 AgentSpeak
-
您可能想在问题中提及这一点。
-
@BitNinja: Apparently not!
-
查看 Jason 库中的 Sniffer 示例,您可以在那里找到答案。类似于:
p1 -> te1(t) : c1(y) <- .send(ag2,tellHow,"p2 -> te2(t) : c2(t) <- a2(t).").
标签: artificial-intelligence agent