Hello,
I implemented a set agents. One is a sender and the others are receivers. I'm working on localhost.
The sender agent sends to all receiver agents to process something and get results.
The following code is a loop for to send a message to all receiver agents :
for i in range(0,len(params.rcvAgents)):
#sending message
msg = spade.ACLMessage.ACLMessage()
msg.setPerformative("request")
#print 'Sender has sent a message to:\n'+params.rcvAgents[i]+'@'+params.host,['xmpp://'+params.rcvAgents[i]+'@'+params.host]
msg.addReceiver(spade.AID.aid(params.rcvAgents[i]+"@"+params.host,["xmpp://"+params.rcvAgents[i]+"@"+params.host]))
msg.setContent(predicted_activity)
self.myAgent.send(msg)
time.sleep(10)
when i run it, i saw that the sender agent sends a message for example to the first receiver agent and dont wait it to finish its works so it sends immediately to the second receiver agent.
To resolve this problem, i add the instruction " time.sleep(10)" and it works fine. But its takes much time.
May be you have another solution ? how does the sender agent wait until the actual receiver agents finishes its works ?
Thank you for your help