【发布时间】:2018-05-25 10:36:48
【问题描述】:
我是翡翠的新手,我想设置一个拍卖代理来提供时间和物品数量,然后......但我收到了这个错误
-
jade 错误代理 a1 在没有被正确终止的情况下死亡。错误 状态 2 我的代码:
int timeout=Integer.parseInt(JOptionPane.showInputDialog("What's Running time of Auction in sec?"));
number=Integer.parseInt(JOptionPane.showInputDialog("What's the number of items?")); //service registration DFAgentDescription dfd = new DFAgentDescription(); dfd.setName(getAID()); ServiceDescription sd = new ServiceDescription(); sd.setType("Uniform-Price-Auction"); sd.setName("Uniform-Price-Auction"); dfd.addServices(sd); try { DFService.register(this, dfd); } catch (FIPAException fe) { fe.printStackTrace(); } // Add the behaviour serving queries from buyer agents addBehaviour(new getBids()); // Add the behaviour serving purchase orders from buyer agents addBehaviour(new DetermineWinner(this,timeout*1000)); gui=new ActioneerGUI(); gui.setVisible(true); gui.setlabel1("We want to sell "+number+" items"); gui.setlabel2("Auction is running...");
【问题讨论】:
-
这段代码是行为代码吗?据我所知,在执行行为期间发生错误时会引发此错误。尝试将所有代码包装在 try-catch 块中以查找错误或查看 concole。有堆栈跟踪吗?
标签: java agents-jade