/***************************************************************** Comm1.java: Program which sends messages to agents it finds ------------ in the AMS (Agent Management Service) Author: Jean Vaucher Date: Aug 10 2003 *****************************************************************/ import jade.core.Agent; import jade.core.behaviours.*; import jade.domain.AMSService; import jade.domain.FIPAAgentManagement.*; import jade.lang.acl.*; public class Comm1 extends Agent { protected void setup() { AMSAgentDescription [] agents = null; try { SearchConstraints c = new SearchConstraints(); c.setMaxResults (new Long(-1)); agents = AMSService.search( this, new AMSAgentDescription (), c ); } catch (Exception e) { System.out.println( "Problem searching AMS: " + e ); e.printStackTrace(); } ACLMessage msg = new ACLMessage(ACLMessage.INFORM); msg.setContent( "Ping" ); for (int i=0; i