I am trying to have a Multi-Agent System on a distributed network (a Windows computer and a Raspberry pi with Raspbian OS installed on). I start my jade platform on windows using this command:
java mylibrary jade.Boot -gui -platfrom-id Platform1 -agents starter:Starter
I also start my jade platform on Raspbian using this command:
java mylibrary jade.Boot -gui -platform-id Raspy1 -agents starter:Starter
This is Starter.java in both computers:
import jade.core.Agent;
import jade.core.behaviours.CyclicBehaviour;
import jade.lang.acl.ACLMessage;
import java.util.Arrays;
public class Starter extends Agent {
@Override
protected void setup() {
System.out.println("Setup of starter agent");
addBehaviour(new ReceiveBehaviour());
}
private class ReceiveBehaviour extends CyclicBehaviour {
@Override
public void action() {
ACLMessage msg = myAgent.receive();
if (msg != null) {
System.out.println(msg.getContent());
System.out.println(Arrays.toString(msg.getSender().getAddressesArray()));
ACLMessage reply = msg.createReply();
reply.setContent("I got it. Thank you " + msg.getSender().getName());
myAgent.send(reply);
} else {
block();
}
}
}
}
Also, this is the mtpaddress in my windows: http://192.168.1.6:7778/acc
and this is the mtpaddress on my raspbian: http://raspy1:7778/acc
Both my computers are connected to a local network (a wireless modem) using wifi.
Now what happens is that, I start my platform on both computers, start a DummyAgent on windows and try to send a message to the raspbian platform. So I add a receiver and put the name and address like the image
below: DymmyAgent in my windows to send message to my raspberry
and this is the console output:
Mar 06, 2020 7:45:33 PM jade.core.messaging.MessagingService deliverNow
WARNING: Cannot deliver message to address: http://raspy1:7778/acc [jade.mtp.MTPException: raspy1 - Caused by: raspy1]. Trying the next one...
Mar 06, 2020 7:45:33 PM jade.core.messaging.MessageManager$Deliverer run
WARNING: Deliverer Thread Deliverer-4 - Delivery-time over threshold (9322). Receiver = da0, message size = 301
( (action ( agent-identifier :name starter@Platform1 :addresses (sequence http://192.168.1.6:7778/acc )) (ACLMessage) ) (MTS-error ( agent-identifier :name da0@Raspy1 :addresses (sequence http://raspy1:7778/acc )) (internal-error "Foreign agent unreachable: No valid address contained within the AID da0@Raspy1")) )
[http://192.168.1.6:7778/acc]
I can send a message from a DummyAgent on raspberry to my windows platform but the opposite way wont happen. What can I do?