RE: [jade-develop] Building behaviours


Subject: RE: [jade-develop] Building behaviours
From: Bellifemine Fabio (Fabio.Bellifemine@TILAB.COM)
Date: Fri Aug 02 2002 - 15:56:24 MET DST


Probably you are using blockingReceive() instead of receive()

-----Original Message-----
From: zze-PRIME Florent FTRD/DIH/LAN [mailto:florent.prime@rd.francetelecom.com]
Sent: 02 August 2002 14:21
To: jade-develop@sharon.cselt.it
Cc: BROUCHOUD Henri FTRD/DIH/LAN
Subject: [jade-develop] Building behaviours

Hi Jaders,

I use different Behaviours in order to implement my agent.
I didn't succeed in building my behaviours for my agent to get the reaction I wanted. My agent is a TravelAgent.

1) If my agent receives a QUERY_REF message from the RequesterAgent, then forward the message to RailAgent and PlaneAgent

2)When it receives an INFORM/REFUSE message from RailAgent and PlaneAgent (Always receive one message from these two agents ), they no further move until you get two messages, then compile information contained in those two messages, and send INFORM/REFUSE to RequesterAgent.

3) if my agent receives a REQUEST message from RequesterAgent, forward either to RailAgent or PlaneAgent, depending on the content of the message.

4) When it receives a CONFIRM/DISCONFIRM message for RailAgent or PlaneAgent, forward to RequesterAgent.

5) My agent can receive INFORM, CANCEL, at any time (indicating that a train or a plane is delayed or canceled. ).

for 1) and 2), I have built a ParallelBehaviour containing 2 subBehaviours, which extend SimpleBehaviour, one for the RailAgent, the other for the PlaneAgent. I have also built another Simplebehaviour, which is directly added to my agent and only matches the Requester.

It works fine. The RequesterSimpleBehviour receives the message, and forward the message without any problems. When INFORM/REFUSE arrives, my 2 subbehaviours react fine, and on the onEnd() of ParallelBehaviour, I can compile the 2 messages, and send one message to the Requester. I reset my behaviour, re-add, and the everything is OK.

for 3) and 4), I have built a behaviour, extending SimpleBehaviour, matching REQUEST, CONFIRM and DISCONFIRM, and I have directly added it to my agent. But it doesn't work.

It blocks everything else. My first behaviours can't match any more

5) is not yet implemented.

All my Messages can arrive at random. I thought that when adding behaviours to my agent, they would be launched when a message matching the template of the behaviour I gave arrived. Apparently they occur only depending on the order I have added them to the agent. Is it true ? So, if I add 2 behaviours matching INFORM, and the other REQUEST, in this order, and that the first message arriving is a REQUEST, is anything supposed to be happening ?

Can you help me build my agent behaviour ?

Building behaviours

Probably you are using blockingReceive() instead of receive()
-----Original Message-----
From: zze-PRIME Florent FTRD/DIH/LAN [mailto:florent.prime@rd.francetelecom.com]
Sent: 02 August 2002 14:21
To: jade-develop@sharon.cselt.it
Cc: BROUCHOUD Henri FTRD/DIH/LAN
Subject: [jade-develop] Building behaviours

Hi Jaders,

I use different Behaviours in order to implement my agent.
I didn't succeed in building my behaviours for my agent to  get the reaction I wanted. My agent is a TravelAgent.

1) If my agent receives a QUERY_REF message from the RequesterAgent, then forward the message to RailAgent and PlaneAgent

2)When it receives an INFORM/REFUSE message from RailAgent and PlaneAgent (Always receive one message from these two agents ), they no further move until you get two messages, then  compile information contained in those two messages, and send INFORM/REFUSE to RequesterAgent.

3) if my agent receives a REQUEST message from RequesterAgent,  forward either to RailAgent or PlaneAgent, depending on the content of the message.

4) When it receives a CONFIRM/DISCONFIRM message for RailAgent or PlaneAgent, forward to RequesterAgent.

5) My agent can receive INFORM, CANCEL, at any time (indicating that a train or a plane is delayed or canceled. ).

for 1) and 2), I have built a ParallelBehaviour containing 2 subBehaviours, which extend SimpleBehaviour, one for the RailAgent, the other for the PlaneAgent. I have also built  another Simplebehaviour, which is directly added to my agent and only matches the Requester.

It works fine. The RequesterSimpleBehviour receives the message, and forward the message without any problems. When INFORM/REFUSE arrives, my 2 subbehaviours react fine, and on the onEnd() of ParallelBehaviour, I can compile the 2 messages, and send one  message to the Requester. I reset my behaviour, re-add, and the everything is OK.

for 3) and 4), I have built a behaviour, extending SimpleBehaviour, matching REQUEST, CONFIRM and DISCONFIRM, and I have directly added it to my agent. But it doesn't work.

It blocks everything else. My first behaviours can't match any more

5) is not yet implemented.

All my Messages can arrive at random. I thought that when adding behaviours to my agent, they would be launched  when a message matching the template of the behaviour I gave arrived. Apparently they occur only depending on the order I have added them to the agent. Is it true ? So, if I add 2 behaviours matching INFORM, and the other REQUEST, in this order, and that the first message arriving is a REQUEST, is anything supposed to be happening ?

Can you help me build my agent behaviour ?




This archive was generated by hypermail 2a22 : Fri Aug 02 2002 - 15:56:42 MET DST