Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Data exchange between Simulink model and JADE agents

22 views
Skip to first unread message

Lisa

unread,
Dec 31, 2011, 11:33:08 PM12/31/11
to
While I was surfing the web on communicating between Simulink model and JADE agents, I came across few postings but did not find any solution. I would like to request you to share with me a sample code to achieve this. Please note that JADE platform and SIMULINK model are on the same machine. My requirement is:

I want to send some i/p data from the simulink block that I have designed to a JADE agent. This JADE agent should take this data and append it with some other text and send it back to simulink.

E.g: Simulink will send the i/p as 100 KW to the Agent.
The Agent should receive this data and append a string "Power," and the resultant output to be returned to Matlab model: "100 KW Power."

**********************Sample code of my Agent*****************************************
package examples.MAS;

import jade.core.Agent;
import jade.core.behaviours.CyclicBehaviour;
import jade.core.messaging.MessagingHelper;
import jade.core.messaging.MessagingService;
import jade.lang.acl.ACLMessage;

public class MASAgent extends Agent {

protected void setup() {
System.out.println("Hello World! My name is "+getLocalName());
//I would like to know how to receive simulink i/p data and create a message with my o/p to be sent back to the simulink block
addBehaviour(new CyclicBehaviour() {
public void action() {
ACLMessage msg = myAgent.receive();
if (msg != null) {
System.out.println("Received message from agent "+msg.getSender().getLocalName()+". Reply...");
ACLMessage reply = msg.createReply();
reply.setPerformative(ACLMessage.NOT_UNDERSTOOD);
myAgent.send(reply);
}
else {
block();
}
}
});
// Make this agent terminate
// doDelete();
}
}


Thanks,
Lisa

Alexander Prostejovsky

unread,
Jan 20, 2012, 1:00:09 PM1/20/12
to
Hi Lisa,

have a look at those papers for possible approaches to your problem:
http://rua.ua.es/dspace/bitstream/10045/16638/1/JoPha_4_3_01.pdf
http://www.softwareresearch.net/fileadmin/src/docs/publications/C102.pdf

As we're apperantly working in the same field (MAS in electric distribution grids in my case) I'd be happy if you keep me informed on your findings!

Best regards,
Alex


"Lisa " <lisa...@yahoo.com> wrote in message <jdonm4$b7h$1...@newscl01ah.mathworks.com>...
0 new messages