0

I have two plans in a Jason agent running in JaCaMo 0.8 platform. For some reason the first plan is being considered not applicable, so the second plan is being chosen.

My question is: How do I know which part of the expression is turning the context false?

// get cached Fundamentals if earlier data are younger than 30 minutes
+!opinion(T)[source(Q)] 
    : .term2string(T,S) & fundamentals::preco(S,_)[seconds_of_day(SSS)] & .time(HH,MM,SS) & (SS+MM*60+HH*60*60 - SSS < 30*60)
    & .date(YY,OO,DD) & lastDate(YYY,OOO,DDD) & YY == YYY & OO == OOO & DD == DDD 
    & fundamentals::lpa(S,_) & fundamentals::vpa(S,_) 
    <- 
    .print("Getting cached fundamentals from ",S); 
    !reply(S,Q);
    .

// get Fundamentals again
+!opinion(T)[source(Q)] : .term2string(T,S) & .date(YY,OO,DD) <- 
    .print("Getting fundamentals from ",S); 
    getFundamentals(S);
    -+lastDate(YY,OO,DD);
    !reply(S,Q);
    .

I have set the looging.properties file for FINE debug, part of the output for the refered agent is:

> [greenblatt] Start new reasoning cycle [greenblatt] Selected event
> +!opinion(ALUP11)[source(myPA)] [greenblatt] Selected intention intention 118: 
>     +!opinion(ALUP11)[source(myPA)] <- ... .print("Getting fundamentals from ",S); getFundamentals(S); -+lastDate(YY,OO,DD);
> !reply(S,Q) / {YY=2019, OO=2, DD=23, Q=myPA, S="ALUP11", T=ALUP11}
> [greenblatt] Getting fundamentals from ALUP11 [greenblatt] Start new
> reasoning cycle

I am missing some information on this log, for instante ".term2string(T,S) & fundamentals::preco(S,_)[seconds_of_day(SSS)] & .time(HH,MM,SS) & (SS+MM*60+HH*60*60 - SSS < 30*60)" was considered true? How to find out such information?

4

1 回答 1

1

您可以将每个周期的代理的心理状态存储在一个文件中,然后检查这些文件以获得一些关于失败的提示。

在 JaCaMo 中,您可以在代理条目中配置该日志:

agent bob {
     mindinspector="file(cycle,xml,log)"
}

最后一个参数是将存储文件的目录的名称。每个文件对应一个头脑样本。它们是具有合适样式表的 XML 文件,可在浏览器中查看。

当然,生成此日志需要相当多的空间/时间,并且会影响应用程序的性能。

于 2019-02-25T10:23:04.190 回答