passing On the AgentID

View: New views
3 Messages — Rating Filter:   Alert me  

passing On the AgentID

by Faraz Fallahi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

ive attached three simpleAgents to illustrate my problem. i want to give an integer (question variable) to agent b. he shall add +1 to the integer and pass it to agent c who will add +5 to it and send the result back to agent a.

how can i do this? i marked the critical points by a "// !!-------------------------------!!" commentary.

greetings fa


_______________________________________________
jade-develop mailing list
jade-develop@...
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm

agents.rar (5K) Download Attachment

RE: passing On the AgentID

by Caire Giovanni-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

Is the sequence of agents to propagate the request to predefined?

Does agent A-n+1 depends on the processing performed by Agent-n?

 

Bye,

 

Giovanni

 


From: jade-develop-bounces@... [mailto:jade-develop-bounces@...] On Behalf Of Faraz Fallahi
Sent: lunedì 26 ottobre 2009 16.13
To: jade-develop@...
Subject: [jade-develop] passing On the AgentID

 

Hi

ive attached three simpleAgents to illustrate my problem. i want to give an integer (question variable) to agent b. he shall add +1 to the integer and pass it to agent c who will add +5 to it and send the result back to agent a.

how can i do this? i marked the critical points by a "// !!-------------------------------!!" commentary.

greetings fa


_______________________________________________
jade-develop mailing list
jade-develop@...
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm

Parent Message unknown RE: passing On the AgentID

by Caire Giovanni-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I’m not sure I have correctly understood what the problem is. Anyway I would implement things as follows.

 

public class AgentN extends Agent {

  ...

  protected void setup() {

    addBehaviour(new CyclicBehaviour(this) {

      public void action() {

        ACLMessage msg = myAgent.receive(some-template);

        if (msg != null) {

          // 1 - Parse the request

          // 2 - Update request if necessary

          // 3 - Identify agent N+1

          // 4 - Forward the request to agent N+1

        }

        else {

          block();

        }

      }

    });

  }

  ...

}

 

If the code necessary to implement operations 1,2,3,4 is fairly complex (and possibly requires interactions with other agents) maybe it is better to enclose it into a behaviour as below

 

public class AgentN extends Agent {

  ...

  protected void setup() {

    addBehaviour(new CyclicBehaviour(this) {

      public void action() {

        ACLMessage msg = myAgent.receive(some-template);

        if (msg != null) {

          myAgent.addBehaviour(new RequestServer(msg);

        }

        else {

          block();

        }

      }

    });

  }

  ...

 

  private class RequestServer ....

 

}

 

 


From: Faraz Fallahi [mailto:faraz.fallahi@...]
Sent: lunedì 26 ottobre 2009 23.02
To: Caire Giovanni
Subject: Re: [jade-develop] passing On the AgentID

 

Hi

2009/10/26 Caire Giovanni <giovanni.caire@...>

Hi,

 

Is the sequence of agents to propagate the request to predefined?

yes, it can either be
agenta calls agentb which calls agent c which calls agenta or
agenta calls agentb which calls agent d which calls agenta
 

Does agent A-n+1 depends on the processing performed by Agent-n?

yes it does. the object passed from a to b to c will be modified in b before passed through.
 

 

Bye,

Giovanni

thank you very much giovanni for the help i do really need this implemented.

greetings fa


 

 


From: jade-develop-bounces@... [mailto:jade-develop-bounces@...] On Behalf Of Faraz Fallahi
Sent: lunedì 26 ottobre 2009 16.13
To: jade-develop@...
Subject: [jade-develop] passing On the AgentID

 

Hi

ive attached three simpleAgents to illustrate my problem. i want to give an integer (question variable) to agent b. he shall add +1 to the integer and pass it to agent c who will add +5 to it and send the result back to agent a.

how can i do this? i marked the critical points by a "// !!-------------------------------!!" commentary.

greetings fa

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.

rispetta l'ambienteRispetta l'ambiente. Non stampare questa mail se non è necessario.

 


_______________________________________________
jade-develop mailing list
jade-develop@...
https://avalon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT
http://jade.tilab.com/community-mailinglist.htm