Examples of AID


Examples of jade.core.AID

                    "{0} is now busy.",
                    myAgent.getLocalName());
            currentMessage = message;

            ACLMessage requestMessage = new ACLMessage(ACLMessage.REQUEST);
            requestMessage.addReceiver(new AID(destinationLocalName, false));
            requestMessage.setContent(message.getContent());
            myAgent.send(requestMessage);
        }
View Full Code Here

Examples of jade.core.AID

     *
     * @param localName The name of the node to kill
     */
    public void killNode(String localName) {
        ACLMessage message = new ACLMessage(ACLMessage.CANCEL);
        message.addReceiver(new AID(localName, false));
        message.setContent("terminate");
        send(message);
    }
View Full Code Here

Examples of jade.core.AID

     *
     * @param localName The name of the node to set to busy
     */
    public void setNodeBusy(String localName) {
        ACLMessage message = new ACLMessage(ACLMessage.REFUSE);
        message.addReceiver(new AID(localName, false));
        message.setContent("busy");
        send(message);
    }
View Full Code Here

Examples of jade.core.AID

   DF-Description must be kept valid. Use null to indicate an infinite
   time
   */
  public static void keepRegistered(Agent a, AID df, final DFAgentDescription dfd, Date deadline) {
    Date lease = dfd.getLeaseTime();
    final AID theDF = (df != null ? df : a.getDefaultDF());
    if (lease != null) {
      if (deadline == null || lease.getTime() < deadline.getTime()) {
        dfd.setLeaseTime(deadline);
        a.addBehaviour(new WakerBehaviour(a, new Date(lease.getTime() - OFFSET)) {
          protected void onWake() {
View Full Code Here

Examples of jade.core.AID

  /**
   The parser content has the form:
   agent-identifier ......) <possibly something else>
   */
  public static AID parseAID(SimpleSLTokenizer parser) throws Exception {
    AID id = new AID("", AID.ISGUID); // Dummy temporary name
    // Skip "agent-identifier"
    parser.getElement();
    while (parser.nextToken().startsWith(":")) {
      String slotName = parser.getElement();
      // Name
      if (slotName.equals(SL0Vocabulary.AID_NAME)) {
        id.setName(parser.getElement());
      }
      // Addresses
      else if (slotName.equals(SL0Vocabulary.AID_ADDRESSES)) {
        Iterator it = parseAggregate(parser).iterator();
        while (it.hasNext()) {
          id.addAddresses((String) it.next());
        }
      }
      // Resolvers
      else if (slotName.equals(SL0Vocabulary.AID_RESOLVERS)) {
        Iterator it = parseAggregate(parser).iterator();
        while (it.hasNext()) {
          id.addResolvers((AID) it.next());
        }
      }
    }
    parser.consumeChar(')');
    return id;
View Full Code Here

Examples of jade.core.AID

   * @param msg The ACL message which we wish to send.
   */
  private void fixReceiverNames(ACLMessage msg) {
    jade.util.leap.Iterator itor = msg.getAllReceiver();
    while (itor.hasNext()) {
      AID receiverAID = (AID)itor.next();
      String receiverName = receiverAID.getName();
      if (receiverName.indexOf('@') < 0) {
        msg.removeReceiver(receiverAID);
        AID newAID = new AID(receiverName, AID.ISLOCALNAME);
        msg.addReceiver(newAID);
        if ( logger.isLoggable( Logger.FINE ) ) {
          logger.log( Logger.FINE, "Changed receiver " + receiverName +
              " to " + newAID.getName());
        }
      }
    }
  }
View Full Code Here

Examples of jade.core.AID

          if ( logger.isLoggable( Logger.FINE ) ) {
            jade.util.leap.Iterator itor = msg.getAllReceiver();
            StringBuffer sb = new StringBuffer();
            while (itor.hasNext()) {
              AID aid = (AID)itor.next();
              sb.append(aid.getName());
              if (itor.hasNext()) {
                sb.append(" ");
              }
            }
            logger.log( Logger.FINE, "Sending message to:" + sb.toString());
View Full Code Here

Examples of jade.core.AID

      // Match the resolvers sequence. See 'FIPA Agent Management Specification, Sect. 6.4.2.1'
      itTemplate = template.getAllResolvers();
      itFact = fact.getAllResolvers();

      while(itTemplate.hasNext()) {
        AID templateRes = (AID)itTemplate.next();

        // Search 'templateRes' into the remaining part of the fact sequence
        boolean found = false;
        while(!found && itFact.hasNext()) {
      AID factRes = (AID)itFact.next();
      found = matchAID(templateRes, factRes); // Recursive call
        }
        if(!found) // An element of the template does not appear in the fact sequence
        return false;
      }
View Full Code Here

Examples of jade.core.AID

    try {
      this.fromAID = envelope.getFrom();
      param = fromAID.getName();
    } catch (NullPointerException e1) {
      param = "";
      this.fromAID = new AID();
    }
    from.setText(param);

    //#DOTNET_EXCLUDE_BEGIN
    toPanel.resetContent(envelope.getAllTo());
    //#DOTNET_EXCLUDE_END
    try{
      AID fromAID = envelope.getFrom();
      param = fromAID.getName();

    }catch(NullPointerException e1){param = "";}
    from.setText(param);

    try{
View Full Code Here

Examples of jade.core.AID

    try {
      this.SenderAID = msg.getSender();
      param = SenderAID.getName();
    } catch (NullPointerException e) {
      param = "";
      this.SenderAID = new AID();
    }

    sender.setText(param);

    //#DOTNET_EXCLUDE_BEGIN
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.