Examples of AID


Examples of jade.core.AID

      fireSentMessage(msg, sender, receiver);
    }
   
    private void handleInformCreated(VerticalCommand cmd) {
      Object[] params = cmd.getParams();
      AID agent = (AID)params[0];
     
      fireBornAgent(agent);
    }
View Full Code Here

Examples of jade.core.AID

      fireBornAgent(agent);
    }
   
    private void handleInformKilled(VerticalCommand cmd) {
      Object[] params = cmd.getParams();
      AID agent = (AID)params[0];
     
      fireDeadAgent(agent);
    }
View Full Code Here

Examples of jade.core.AID

      fireDeadAgent(agent);
    }
   
    private void handleInformStateChanged(VerticalCommand cmd) {
      Object[] params = cmd.getParams();
      AID id = (AID)params[0];
      AgentState from = (AgentState)params[1];
      AgentState to = (AgentState)params[2];
     
      fireChangedAgentState(id, from, to);
    }
View Full Code Here

Examples of jade.core.AID

      try {
        String cmdName = cmd.getName();
        Object[] params = cmd.getParams();
       
        if(cmdName.equals(NotificationSlice.H_SNIFFON)) {
          AID snifferName = (AID)params[0];
          AID targetName = (AID)params[1];
         
          sniffOn(snifferName, targetName);
        }
        else if(cmdName.equals(NotificationSlice.H_SNIFFOFF)) {
          AID snifferName = (AID)params[0];
          AID targetName = (AID)params[1];
         
          sniffOff(snifferName, targetName);
        }
        else if(cmdName.equals(NotificationSlice.H_DEBUGON)) {
          AID introspectorName = (AID)params[0];
          AID targetName = (AID)params[1];
         
          debugOn(introspectorName, targetName);
        }
        else if(cmdName.equals(NotificationSlice.H_DEBUGOFF)) {
          AID introspectorName = (AID)params[0];
          AID targetName = (AID)params[1];
         
          debugOff(introspectorName, targetName);
        }
      }
      catch(Throwable t) {
View Full Code Here

Examples of jade.core.AID

   
    private void sniffOn(AID snifferName, AID targetName) throws IMTPException {
      ToolNotifier tn = findNotifier(snifferName);
      if(tn == null) { // Need a new notifier
        tn = new ToolNotifier(snifferName);
        AID id = new AID(snifferName.getLocalName() + "-on-" + myID().getName(), AID.ISLOCALNAME);
        try {
          myContainer.initAgent(id, tn, null, null); // FIXME: Modify to use a proper owner Principal
          myContainer.powerUpLocalAgent(id);
          helper.registerMessageListener(tn);
        }
View Full Code Here

Examples of jade.core.AID

   
    private void debugOn(AID introspectorName, AID targetName) throws IMTPException {
      // AMS debug enabling must be done by a separated Thread to avoid
      // deadlock with ToolNotifier startup
      if (targetName.equals(myContainer.getAMS()) && !(Thread.currentThread().getName().equals(AMS_DEBUG_HELPER))) {
        final AID in = introspectorName;
        final AID tg = targetName;
        Thread helper = new Thread(new Runnable() {
          public void run() {
            try {
              debugOn(in, tg);
            }
            catch(IMTPException imtpe) {
              imtpe.printStackTrace();
            }
          }
        });
        helper.setName(AMS_DEBUG_HELPER);
        helper.start();
        return;
      }
     
      // Get the ToolNotifier for the indicated debugger (or create a new one
      // if not yet there)
      ToolNotifier tn = findNotifier(introspectorName);
      if(tn == null) { // Need a new notifier
        tn = new ToolNotifier(introspectorName);
        AID id = new AID(introspectorName.getLocalName() + "-on-" + myID().getName(), AID.ISLOCALNAME);
        try {
          myContainer.initAgent(id, tn, null, null); // FIXME: Modify to use a proper owner Principal
          myContainer.powerUpLocalAgent(id);
          if (targetName.equals(myContainer.getAMS())) {
            // If we are debugging the AMS, let's wait for the ToolNotifier
View Full Code Here

Examples of jade.core.AID

   *
   * @return    The SendTo value
   */
  public String getSendTo() {
    if (theMessage.getAllReceiver().hasNext()) {
      AID sender = (AID)theMessage.getAllReceiver().next();
      return sender.getName();
    }
    return "<unknown>";
  }
View Full Code Here

Examples of jade.core.AID

  }


  public String receivedFrom() {
    if (theMessage.getSender() != null) {
      AID sender = theMessage.getSender();
      return sender.getName();
    }
    return "<unknown>";
  }
View Full Code Here

Examples of jade.core.AID

    // CREATE AGENT
    if (action instanceof CreateAgent) {
      theAMS.createAgentAction((CreateAgent) action, request.getSender(), requesterPrincipal, requesterCredentials);
      String agentName = JADEManagementOntology.adjustAgentName(((CreateAgent) action).getAgentName(), new String[] {((CreateAgent) action).getContainer().getName()});
      asynchNotificationKey = new AID(agentName, AID.ISLOCALNAME);
    }
    // KILL AGENT (asynchronous notification to requester)
    else if (action instanceof KillAgent) {
      theAMS.killAgentAction((KillAgent) action, request.getSender(), requesterPrincipal, requesterCredentials);
      asynchNotificationKey = ((KillAgent) action).getAgent();
    }
    // CLONE AGENT (asynchronous notification to requester)
    // Note that CloneAction extends MoveAction --> must be considered first!!!
    else if (action instanceof CloneAction) {
      theAMS.cloneAgentAction((CloneAction) action, request.getSender());
      asynchNotificationKey = new AID(((CloneAction) action).getNewName(), AID.ISLOCALNAME);
    }
    // MOVE AGENT (asynchronous notification to requester)
    else if (action instanceof MoveAction) {
      theAMS.moveAgentAction((MoveAction) action, request.getSender());
      asynchNotificationKey = ((MoveAction) action).getMobileAgentDescription().getName();
View Full Code Here

Examples of jade.core.AID

/**
* This class embeds topic related utility methods that must be available in MIDP
*/
public class TopicUtility {
  public static final AID createTopic(String topicName) {
    return new AID(topicName+'@'+TopicManagementHelper.TOPIC_SUFFIX, AID.ISGUID);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.