一些有用的JADE代码 - MiTKooK‘s Technical Blog - CSDN...
来源:百度文库 编辑:神马文学网 时间:2024/07/03 08:32:31
一些有用的JADE代码
Naming a new container
Runtime rt = Runtime.instance(); // Get a hold on JADE runtime
Profile p = new ProfileImpl(); // Create a default profile
p.setParameter(Profile.CONTAINER_NAME, "your-container-name-goes-here");
AgentContainer ac;
if (MainContainer) ac = rt.createMainContainer(p);
else ac = rt.createAgentContainer(p);
ac.createNewAgent(...
Request the AMS to Perform the CreateAgent action
/**//*to REQUEST AMS agent to launch mobile agents*/
// Get a hold on JADE runtime Object[] args=getArguments();
AgentContainer mc = (AgentContainer) args[0];
CreateAgent ca=new CreateAgent();
ca.setClassName("sma.MobileAgent");
ca.setAgentName("AM_0");
ContainerID id=new ContainerID();
id.setName(mc.getName());
ca.setContainer(id);
ACLMessage request = new ACLMessage(ACLMessage.REQUEST);
request.setLanguage(FIPANames.ContentLanguage.FIPA_SL);
request.setOntology(JADEManagementOntology.NAME);
Action action=new Action();
action.setActor(getAMS());
action.setAction(ca);
try ...{
getContentManager().fillContent(request, action);
send(request);
}
catch (Exception ex) ...{ ex.printStackTrace(); }
Naming a new container
Runtime rt = Runtime.instance(); // Get a hold on JADE runtime
Profile p = new ProfileImpl(); // Create a default profile
p.setParameter(Profile.CONTAINER_NAME, "your-container-name-goes-here");
AgentContainer ac;
if (MainContainer) ac = rt.createMainContainer(p);
else ac = rt.createAgentContainer(p);
ac.createNewAgent(...
Request the AMS to Perform the CreateAgent action
/**//*to REQUEST AMS agent to launch mobile agents*/
// Get a hold on JADE runtime Object[] args=getArguments();
AgentContainer mc = (AgentContainer) args[0];
CreateAgent ca=new CreateAgent();
ca.setClassName("sma.MobileAgent");
ca.setAgentName("AM_0");
ContainerID id=new ContainerID();
id.setName(mc.getName());
ca.setContainer(id);
ACLMessage request = new ACLMessage(ACLMessage.REQUEST);
request.setLanguage(FIPANames.ContentLanguage.FIPA_SL);
request.setOntology(JADEManagementOntology.NAME);
Action action=new Action();
action.setActor(getAMS());
action.setAction(ca);
try ...{
getContentManager().fillContent(request, action);
send(request);
}
catch (Exception ex) ...{ ex.printStackTrace(); }
一些有用的JADE代码 - MiTKooK‘s Technical Blog - CSDN...
怎样优化Pentium系列处理器的代码 - soarwell's blog - CSDN博客
收集一些有用的代码
VC中#pragma warning指令 - Henry's Technical Blog...
一些网页中常用的精华代码s
傻瓜版的一些常用的新浪BLOG的代码
Jang‘s blog: 搭建个人门户需要的一些程序
Jang‘s blog: 搭建个人门户需要的一些程序
Jang‘s blog: 搭建个人门户需要的一些程序
一些广东话的输入法资料--Nicholas‘s Blog No.1
一些广东话的输入法资料--Nicholas‘s Blog No.1
ASP一些初学者常用的代码!- crazywolf - 新浪BLOG
制作pubbylinux的u盘启动盘步骤 - ZJSen's Blog - CSDN博客
面向程序员的数据库访问性能优化法则 - MKing's Blog - CSDN博客
面向程序员的数据库访问性能优化法则 - MKing's Blog - CSDN博客
C#好书推荐与一些个人读后感 - MsdnProgrammer的代码世界 - CSDN博客
一些日文软件 - Time's BLOG
TL2_x86代码的分析(1) - 我的文章 - freearth's blog
vitter‘s blog: [原创]windows下用openssh、ant、vss控制java项目的代码开发
值得收藏的JavaScript代码 - ξσ Dicky‘s Blog σξ - 博客园
有用的一些感悟.
有用的一些感悟
一些有用的网址
有用的一些感悟