Reputation: 21
I have some simple HelloWorld agents living on a local jade platform and communicating amongst themselves. Now I need to connect to them with locally run java code, extract some data from a Receiver agent and for now just print it to console (I don't want an agent doing that).
I have no idea how to do that. :S
I was mainly thinking about communicating via ACL messages to the Receiver agent, but I don't know how to connect to the platform and find the Receiver agent. However, if there is a way to connect directly to an Agent, this task would be even easier.
So, if anybody has any experience with this, please tell me how to transfer data from agent to local java code. Tutorials are also very welcome :)
Thanks for helping, Nejc
Upvotes: 1
Views: 547
Reputation: 21
I found out that Jade has a feature called JadeGateway,
which can be implemented as a simple Java class.
When it is executed, it links to a running Jade environment, specified via "host" and "port". There it creates a temporary agent, which is capable of sending and receiving messages. The result form these received messages can be then returned to a calling class with a simple return statement.
This is a very simple way to get data from running agents.
More on this can be found in included example in Jade distribution:
~JADE_HOME\jade-examples\jade\src\examples\inprocess\JadeGatewayExample.java
Upvotes: 1