1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| //Get the JADE runtime interface (singleton)
jade.core.Runtime runtime = jade.core.Runtime.instance();
//Create a Profile, where the launch arguments are stored
Profile profile = new ProfileImpl();
profile.setParameter(Profile.CONTAINER_NAME, "Noeud");
profile.setParameter(Profile.MAIN_HOST, "localhost");
//create a non-main agent container
ContainerController container = runtime.createAgentContainer(profile);
try {
AgentController ag = container.createNewAgent("agentnick",
"my.agent.package.AgentClass",
new Object[] {});//arguments
ag.start();
} catch (StaleProxyException e) {
e.printStackTrace();
} |
Partager