Discussion:
[jade-develop] Multiple protocols in a single agent
Luis Lezcano Airaldi
2014-05-23 17:28:15 UTC
Permalink
Hello list!

I'm having an issue with nested protocols. I have an agent which has a
ContractNetResponder and, inside the responder, there is a
ContractNetInitiator.

Also, it has a SubscriptionInitiator to subscribe to the DF, to be notified
when certain agents register.

The problem is that I'm receiving the _initial_ INFORM message from the DF in
the prepareCfps(ACLMessage cfp) method of the initiator. Subsequent messages
are received just fine in the handleInform() method of the
SubscriptionInitiator.

I think there is a way of handling this, but I'm not sure how. I need to tell
the ContractNetInitiator to ignore the INFORM message from the df, so it can
be processed by the SubscriptionInitiator. Is there a method I should
override, that I'm not aware of?

Thanks for your help.
Regards.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140523/561fd189/attachment.pgp>
Caire Giovanni
2014-05-27 21:35:36 UTC
Permalink
Hi,

If I understood the point correctly, there are several ways to solve the problem. The simplest one is certainly using different conversation-ids for the SubscriptionInitiator and the ContractNetInitiator.
In general a good heuristic rule that allows managing message reception in a large majority of cases is as follows:
- Use MessageTemplates that match on ontology (and if necessary performative) for responder behaviours.
- Use suitable conversation-ids for initiator behaviours.

Bye,

Giovanni

-----Messaggio originale-----
Da: jade-develop-bounces at avalon.tilab.com [mailto:jade-develop-bounces at avalon.tilab.com] Per conto di Luis Lezcano Airaldi
Inviato: venerd? 23 maggio 2014 19:28
A: jade-develop
Oggetto: [jade-develop] Multiple protocols in a single agent

Hello list!

I'm having an issue with nested protocols. I have an agent which has a ContractNetResponder and, inside the responder, there is a ContractNetInitiator.

Also, it has a SubscriptionInitiator to subscribe to the DF, to be notified when certain agents register.

The problem is that I'm receiving the _initial_ INFORM message from the DF in the prepareCfps(ACLMessage cfp) method of the initiator. Subsequent messages are received just fine in the handleInform() method of the SubscriptionInitiator.

I think there is a way of handling this, but I'm not sure how. I need to tell the ContractNetInitiator to ignore the INFORM message from the df, so it can be processed by the SubscriptionInitiator. Is there a method I should override, that I'm not aware of?

Thanks for your help.
Regards.
Luis Lezcano Airaldi
2014-05-28 02:32:45 UTC
Permalink
Post by Caire Giovanni
Hi,
If I understood the point correctly, there are several ways to solve the
problem. The simplest one is certainly using different conversation-ids for
the SubscriptionInitiator and the ContractNetInitiator.
In general a good
heuristic rule that allows managing message reception in a large majority
of cases is as follows: - Use MessageTemplates that match on ontology (and
if necessary performative) for responder behaviours. - Use suitable
conversation-ids for initiator behaviours.
Hi.

Thanks for your reply. Indeed I was passing a null MessageTemplate in the
constructor of the Responder. I think I got carried away by the examples in
the tutorials.

Regards.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://avalon.cselt.it/pipermail/jade-develop/attachments/20140527/626d08c9/attachment.pgp>
Continue reading on narkive:
Loading...