Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tutorial 3 ACL: Agent Communication Language

Similar presentations


Presentation on theme: "Tutorial 3 ACL: Agent Communication Language"— Presentation transcript:

1 Tutorial 3 ACL: Agent Communication Language
Dr. Fuhua Lin School of Computing and Information Systems Athabasca University, Alberta, Canada Oct. 27, 2009

2 Initiate a conversation using SimpleAchieveREInitiator
public class SimpleRequestInitiator extends Agent {    static class MarriageProposer extends SimpleAchieveREInitiator { protected MarriageProposer(Agent agent, ACLMessage msg) {            super(agent, msg);        } … … 2. Message Sending In the parent class 1. Message construction } Reference:

3 Using Standard Handlers as methods of MarriageProposer
protected void handleAgree(ACLMessage msg) {            System.out.println(myAgent.getLocalName() + ": Ha Ha! " +            msg.getSender().getLocalName() +” has already agreed to marry me. I'm so excited!");  }         protected void handleRefuse(ACLMessage msg) {            System.out.println(myAgent.getLocalName() + ": Oh no! " +            msg.getSender().getLocalName() +rejected me. I feel sad.");   } protected void handleInform(ACLMessage msg) {            System.out.println(myAgent.getLocalName() + ":" +            msg.getSender().getLocalName() +" has informed me of the status of my request." +            " They said : " + msg.getContent());        }        protected void handleNotUnderstood(ACLMessage msg){            System.out.println(myAgent.getLocalName() + ":"                + msg.getSender().getLocalName() +                " has indicated that they didn't understand.");        }        protected void handleOutOfSequence(ACLMessage msg) {            System.out.println(myAgent.getLocalName() + ":"                 + msg.getSender().getLocalName() +  "has sent me a message which I wasn't" +                " expecting in this conversation"); }

4 SimpleRequestResponder

5

6

7

8


Download ppt "Tutorial 3 ACL: Agent Communication Language"

Similar presentations


Ads by Google