0

Jason 附带了一个演示,它使用表演性的“tellRule”来发送规则,但在我的测试中它不起作用。我试图像这样发送给自我代理:

.send(self,tellRule, [{a :- b & c}])

结果是:

Command .send(self,tellRule, [{a :- b & c}]): included for execution
Communication error -- no_applicable: Found a goal for which there is no applicable plan:+!kqml_received(self,tellRule,[{ a :- (b & c)}],mid511)
4

1 回答 1

0

实际上,Jason 并没有默认定义“tellRule”执行。事实上,上面提到的演示是在教如何添加 KQML 表演。因此,对于您的代码工作,您应该首先创建“tellRule”,如下所示:

.send(self, tellHow, {+!kqml_received(A,tellRule,Rules,_) <- 
    .print("Received rule(s) ",Rules, " from ",A); 
    for ( .member(R, Rules) ) 
    {+R[source(A)];}  
    .relevant_rules(_,LR);       
    .print("Rules: ",LR)}).

在此之后,您可以运行以下命令:

.send(self,tellRule, [{a :- b & c}]).

顺便说一句,同样的想法可以用来创建类似“untellRule”的东西:

.send(self, tellHow, {+!kqml_received(A,untellRule,Rules,_) <-      
    .print("Removing rule(s) ",Rules, " from ",A);      
    for ( .member(R, Rules) )      
    {-R}}).
.send(self,untellRule,[{a :- b & c}]).
于 2019-04-07T19:33:35.473 回答