我试图让bdi代理选择一个特定的意图句柄,而不是其他相互竞争的意图。然而,相互竞争的意图仍然同时执行。这是我的密码:
private Trigger handle = Trigger.parseTrigger("+!handle(claim)");
@Override
public Intention selectIntention(Queue<Intention> intentions) {
Iterator<Intention> i = intentions.iterator();
while (i.hasNext()) {
Intention cit = i.next();
if (cit.hasTrigger(unattendedLuggage, new Unifier())) {
System.out.println(cit);
i.remove();
return cit;
}
else{System.out.println(cit);}
}
return super.selectIntention(intentions);
}
}
暂无答案!
目前还没有任何答案,快来回答吧!