简体   繁体   English

获取翡翠容器中的代理列表

[英]Getting list of agents in container in jade

How can i get list of agents (their names like "da0@ip" etc.) in specified container in jade in java? 如何在Java的Jade中的指定容器中获取代理列表(它们的名称,如“ da0 @ ip”等)? I've looked and only thing i can find is a list of ALL agents in all containers. 我看过了,唯一能找到的是所有容器中所有代理的列表。 I'm not really into jade, it's just a school project so any advice would be helpful. 我不是很喜欢翡翠,那只是一个学校项目,所以任何建议都会有所帮助。

You can try to use AMS agent that is to send the request to it and handle responce. 您可以尝试使用将请求发送给它并处理响应的AMS代理。 Something like: 就像是:

QueryAgentsOnLocation ca = new QueryAgentsOnLocation();
ca.setLocation(...); // here is the information about you ontainer
Action actExpr = new Action(myAgent.getAMS(), ca);

ACLMessage request = new ACLMessage(ACLMessage.REQUEST);
request.addReceiver(myAgent.getAMS());
request.setOntology(JADEManagementOntology.getInstance().getName());
request.setLanguage(FIPANames.ContentLanguage.FIPA_SL);
request.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);
myAgent.getContentManager().fillContent(request, actExpr);
myAgent.send(request);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM