A有3个以agentpeak形式编写的工作代理。其中两个的信念为+ number(someNumber),第三个正试图计算这两个的最小值。我现在拥有的是中间代理从两个代理接收两个文字,但是由于两者都是文字,因此无法在此处使用正常的math.min()操作:
+!test: iam(root) <-
.send("agent14",askOne,number(RE),L);
.send("agent15",number(RE2),R);
.print("Both got numbers: ",L," ",R);
+number(math.min(L,R));
.print("DONE").
此处math.min()函数会产生错误,因为未针对数据类型实现该错误:
[ArithFunctionTerm] Error in 'math.min(L,R)' (agent.asl:36) -- error in evaluate!
jason.JasonException: math.min is not implemented for type 'number(65)[source(agent14)]'.
有没有办法比较这两个值?