Re: [jade-develop] behaviours


Subject: Re: [jade-develop] behaviours
From: Ignazio Pi (ignazio_io@hotmail.com)
Date: Tue Oct 01 2002 - 14:11:37 MET DST


Hi,
you can use the putback() method; if it doesn't work, try with a more specific MessageTemplate. Otherwise, you can write a dispatcher for your messages.
Bye!
  ----- Original Message -----
  From: Alexander Osherenko
  To: JADE
  Sent: Tuesday, October 01, 2002 11:49 AM
  Subject: [jade-develop] behaviours

  Hello,
   
  how could I solve the problem of forwarding messages if I have several behaviours that call the blockingReceive method and each behaviour waits for a specific message?
   
  For example:
   
  class Behaviour1 {
      ...
      void action() {
          ACLMessage msg = blockingReceive();
          ...
          if (messageToken instanceof dummy1) {
              ....
          }
      }
  }
   
  class Behaviour2 {
      ...
      void action() {
          ACLMessage msg = blockingReceive();
          ...
          if (messageToken instanceof dummy2) {
              ....
          }
      }
  }
   
  The problem is that the original message which is defined for Behaviour2 would be processed by the Behaviour1.
   
  Cheers
   
  Alexander

Hi,
you can use the putback() method; if it doesn't work, try with a more specific MessageTemplate. Otherwise, you can write a dispatcher for your messages.
Bye!
----- Original Message -----
From: Alexander Osherenko
To: JADE
Sent: Tuesday, October 01, 2002 11:49 AM
Subject: [jade-develop] behaviours

Hello,
 
how could I solve the problem of forwarding messages if I have several behaviours that call the blockingReceive method and each behaviour waits for a specific message?
 
For example:
 
class Behaviour1 {
    ...
    void action() {
        ACLMessage msg = blockingReceive();
        ...
        if (messageToken instanceof dummy1) {
            ....
        }
    }
}
 
class Behaviour2 {
    ...
    void action() {
        ACLMessage msg = blockingReceive();
        ...
        if (messageToken instanceof dummy2) {
            ....
        }
    }
}
 
The problem is that the original message which is defined for Behaviour2 would be processed by the Behaviour1.
 
Cheers
 
Alexander



This archive was generated by hypermail 2a22 : Tue Oct 01 2002 - 14:09:47 MET DST