如何在JaCaMo中正确停止?

时间:2017-10-25 21:00:31

标签: agent multi-agent

我有一个JaCaMo项目,当我想要添加一个相信时,我想停止系统:

+winner <- .stopMAS.

我在一个纯粹的Jason项目中这样做,但是在我有一个组织的JaCaMo项目中,在这个stopMAS命令之后,CArtAgO API中出现了一个错误,如下所示:

java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
    at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
    at java.util.concurrent.ArrayBlockingQueue.put(ArrayBlockingQueue.java:350)
    at cartago.WorkspaceKernel.execOp(WorkspaceKernel.java:782)
    at cartago.WorkspaceKernel.execOp(WorkspaceKernel.java:600)
    at cartago.AgentBody.doAction(AgentBody.java:72)
    at cartago.CartagoSession.doAction(CartagoSession.java:86)
    at jacamo.infra.JaCaMoAgArch.stop(JaCaMoAgArch.java:198)
    at jason.architecture.AgArch.stop(AgArch.java:57)
    at jason.infra.centralised.CentralisedAgArch.stopAg(CentralisedAgArch.java:113)
    at jason.infra.centralised.RunCentralisedMAS.stopAgs(RunCentralisedMAS.java:728)
    at jason.infra.centralised.RunCentralisedMAS.finish(RunCentralisedMAS.java:826)
    at jason.infra.centralised.CentralisedRuntimeServices.stopMAS(CentralisedRuntimeServices.java:110)
    at jason.stdlib.stopMAS.execute(stopMAS.java:44)
    at jason.asSemantics.TransitionSystem.applyExecInt(TransitionSystem.java:736)
    at jason.asSemantics.TransitionSystem.applySemanticRuleAct(TransitionSystem.java:237)
    at jason.asSemantics.TransitionSystem.act(TransitionSystem.java:1525)
    at jason.infra.centralised.CentralisedAgArch.act(CentralisedAgArch.java:203)
    at jason.infra.centralised.CentralisedAgArch.reasoningCycle(CentralisedAgArch.java:212)
    at jason.infra.centralised.CentralisedAgArch.run(CentralisedAgArch.java:231)
    at java.lang.Thread.run(Thread.java:748)
cartago.CartagoException: exec op exception.
    at cartago.WorkspaceKernel.execOp(WorkspaceKernel.java:786)
    at cartago.WorkspaceKernel.execOp(WorkspaceKernel.java:600)
    at cartago.AgentBody.doAction(AgentBody.java:72)
    at cartago.CartagoSession.doAction(CartagoSession.java:86)
    at jacamo.infra.JaCaMoAgArch.stop(JaCaMoAgArch.java:198)
    at jason.architecture.AgArch.stop(AgArch.java:57)
    at jason.infra.centralised.CentralisedAgArch.stopAg(CentralisedAgArch.java:113)
    at jason.infra.centralised.RunCentralisedMAS.stopAgs(RunCentralisedMAS.java:728)
    at jason.infra.centralised.RunCentralisedMAS.finish(RunCentralisedMAS.java:826)
    at jason.infra.centralised.CentralisedRuntimeServices.stopMAS(CentralisedRuntimeServices.java:110)
    at jason.stdlib.stopMAS.execute(stopMAS.java:44)
    at jason.asSemantics.TransitionSystem.applyExecInt(TransitionSystem.java:736)
    at jason.asSemantics.TransitionSystem.applySemanticRuleAct(TransitionSystem.java:237)
    at jason.asSemantics.TransitionSystem.act(TransitionSystem.java:1525)
    at jason.infra.centralised.CentralisedAgArch.act(CentralisedAgArch.java:203)
    at jason.infra.centralised.CentralisedAgArch.reasoningCycle(CentralisedAgArch.java:212)
    at jason.infra.centralised.CentralisedAgArch.run(CentralisedAgArch.java:231)
    at java.lang.Thread.run(Thread.java:748)
[GroupBoard] p1 has quit, role participant removed by the platform!

如何避免此错误?在这个stopMAS命令之前有什么我应该做的吗?

1 个答案:

答案 0 :(得分:3)

您可以忽略此消息。最新版本的JaCaMo(0.7-SNAPSHOT)解决了这个问题。