public static void main(String args[]) throws Exception { // Get a hold on JADE runtime jade.core.Runtime rt = jade.core.Runtime.instance(); // Exit the JVM when there are no more containers around rt.setCloseVM(true); // Create a default profile Profile p = new ProfileImpl(); p.setParameter("preload", "a*"); p.setParameter(Profile.MAIN_PORT, "60000"); if (args.length == 2 && args[1].equalsIgnoreCase("pause")) { ingenias.jade.graphics.MainInteractionManager.goManual(); } if (new File("target/jade").exists() && new File("target/jade").isDirectory()) p.setParameter(Profile.FILE_DIR, "target/jade/"); else { // from http://stackoverflow.com/questions/617414/create-a-temporary-directory-in-java final File temp; temp = File.createTempFile("jade", Long.toString(System.nanoTime())); if (!(temp.delete())) { throw new IOException("Could not delete temp file: " + temp.getAbsolutePath()); } if (!(temp.mkdir())) { throw new IOException("Could not create temp directory: " + temp.getAbsolutePath()); } p.setParameter(Profile.FILE_DIR, temp.getAbsolutePath() + "/"); } // Create a new non-main container, connecting to the default // main container (i.e. on this host, port 1099) final jade.wrapper.AgentContainer ac = rt.createAgentContainer(p); { // Create a new agent final jade.wrapper.AgentController agcGUIAgent_0DeploymentUnitByType0 = ac.createNewAgent( "GUIAgent_0DeploymentUnitByType0", "ingenias.jade.agents.GUIAgentJADEAgent", new Object[0]); new Thread() { public void run() { try { System.out.println("Starting up GUIAgent_0DeploymentUnitByType0..."); agcGUIAgent_0DeploymentUnitByType0.start(); } catch (Exception e) { e.printStackTrace(); } } }.start(); // Create a new agent final jade.wrapper.AgentController agcGUIAgent_1DeploymentUnitByType0 = ac.createNewAgent( "GUIAgent_1DeploymentUnitByType0", "ingenias.jade.agents.GUIAgentJADEAgent", new Object[0]); new Thread() { public void run() { try { System.out.println("Starting up GUIAgent_1DeploymentUnitByType0..."); agcGUIAgent_1DeploymentUnitByType0.start(); } catch (Exception e) { e.printStackTrace(); } } }.start(); // Create a new agent final jade.wrapper.AgentController agcGUIAgent_2DeploymentUnitByType0 = ac.createNewAgent( "GUIAgent_2DeploymentUnitByType0", "ingenias.jade.agents.GUIAgentJADEAgent", new Object[0]); new Thread() { public void run() { try { System.out.println("Starting up GUIAgent_2DeploymentUnitByType0..."); agcGUIAgent_2DeploymentUnitByType0.start(); } catch (Exception e) { e.printStackTrace(); } } }.start(); } MainInteractionManager.getInstance().setTitle("node SampleDeployment"); }