15490289 at sun.ac.za (Claassen, M, Mnr )
2014-07-21 10:52:25 UTC
Good day,
I have solved my own problem. I made the silly mistake of using jade.domain.introspection.ACLMessage instead of jade.lang.acl.ACLMessage.
Silly...silly mistake. :)
________________________________
From: Claassen, M, Mnr <15490289 at sun.ac.za>
Sent: 21 July 2014 12:00 PM
To: jade-develop at avalon.tilab.com
Subject: DF Subscription
Good day,
I would like to get an inform message from the DF when a specific service ("CLAMP") has been registered with the DF. I implemented the code below. I registered an agent that provided a "CLAMP" service with the DF. I sniffed the DF agent and the agent who was supposed to receive the inform message and saw that it successfully received the inform message. However, it does not seem that the program goes into the "handleInform" method. I confirmed this through debugging and through the fact that it does not print the agent name to the console....any ideas why?
DFAgentDescription serviceTemplate = new DFAgentDescription();
ServiceDescription serviceDescription = new ServiceDescription();
serviceDescription.setType(AgentConstants.CLAMP);
serviceTemplate.addServices(serviceDescription);
Behaviour b = new SubscriptionInitiator(this, DFService.createSubscriptionMessage(this, getDefaultDF(), serviceTemplate, null)){
protected void handleInform(ACLMessage inform) {
try {
DFAgentDescription[] dfds = DFService.decodeNotification(inform.getPayload());
System.out.println("Agent Name: " +dfds[0].getName());
}
catch (FIPAException fe) {
fe.printStackTrace();
}
}
};
addBehaviour(b);
Kind Regards,
Marius Claassen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jade.tilab.com/pipermail/jade-develop/attachments/20140721/1416ee93/attachment.html>
I have solved my own problem. I made the silly mistake of using jade.domain.introspection.ACLMessage instead of jade.lang.acl.ACLMessage.
Silly...silly mistake. :)
________________________________
From: Claassen, M, Mnr <15490289 at sun.ac.za>
Sent: 21 July 2014 12:00 PM
To: jade-develop at avalon.tilab.com
Subject: DF Subscription
Good day,
I would like to get an inform message from the DF when a specific service ("CLAMP") has been registered with the DF. I implemented the code below. I registered an agent that provided a "CLAMP" service with the DF. I sniffed the DF agent and the agent who was supposed to receive the inform message and saw that it successfully received the inform message. However, it does not seem that the program goes into the "handleInform" method. I confirmed this through debugging and through the fact that it does not print the agent name to the console....any ideas why?
DFAgentDescription serviceTemplate = new DFAgentDescription();
ServiceDescription serviceDescription = new ServiceDescription();
serviceDescription.setType(AgentConstants.CLAMP);
serviceTemplate.addServices(serviceDescription);
Behaviour b = new SubscriptionInitiator(this, DFService.createSubscriptionMessage(this, getDefaultDF(), serviceTemplate, null)){
protected void handleInform(ACLMessage inform) {
try {
DFAgentDescription[] dfds = DFService.decodeNotification(inform.getPayload());
System.out.println("Agent Name: " +dfds[0].getName());
}
catch (FIPAException fe) {
fe.printStackTrace();
}
}
};
addBehaviour(b);
Kind Regards,
Marius Claassen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jade.tilab.com/pipermail/jade-develop/attachments/20140721/1416ee93/attachment.html>