简体   繁体   中英

Protocol on Jade Agents with ACL

I wanted to develop a protocol between two agents (in different platforms), for example between Agent1 and Agent2:

1.Agent1 send a message to Agent2 with a nonce
2.Agent2 receive the nonce, make a mathematic operation and then send to Agent1
3.Agent1 receive the message and sent Agent2 an ACK

so i want to create a function called for example doProtocol(Location destiny, int nonce) and do that process automatically

I know how to send or receive messages but i cant find how to do that simultaneously Anyone can help me?

I would use FIPA-RequestInteraction.

Agent 1, add behaviour AchieveREInitiation. In the PrepareRequest specify your function

prepareRequest(ACLmessage request)
{
  request =  getNonceMsg();
  return request;
}
handleInform(ACLmessage reply)
{
  //acknowledge response if you want to.
}

Agent 2, add behaviour AchieveREResponder. In the prepareResponse specify your function

prepareResponse(ACLmessage reply)
{
  response =  compileResponse(reply.getContent());
  return response;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM