es.upv.dsic.gti_ia.cAgents.protocols
Class FIPA_REQUEST_Participant

java.lang.Object
  extended by es.upv.dsic.gti_ia.cAgents.protocols.FIPA_REQUEST_Participant

public abstract class FIPA_REQUEST_Participant
extends Object

Template for CFactories that manage fipa request participant conversation. The user has to create his/her own class extending from this one. And implement the abstract methods. Other methods can be overriden in order to modify the default behaviour

Author:
ricard

Constructor Summary
FIPA_REQUEST_Participant()
           
 
Method Summary
protected abstract  String doAction(CProcessor myProcessor)
          Perform the requested action
protected  void doAgree(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the agree message
protected  void doBegin(CProcessor myProcessor, ACLMessage msg)
          Method executed at the beginning of the conversation
protected  void doFailure(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the failure message
protected  void doFinal(CProcessor myProcessor, ACLMessage messageToSend)
          Method executed when the conversation ends
protected abstract  void doInform(CProcessor myProcessor, ACLMessage response)
          Sets the inform message
protected  void doNotUnderstood(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the not-understood message
protected abstract  String doReceiveRequest(CProcessor myProcessor, ACLMessage request)
          Method executed when the initiator receives the request
protected  void doRefuse(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the refuse message
 CFactory newFactory(String name, MessageFilter filter, int availableConversations, CAgent myAgent)
          Creates a new participant fipa request factory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIPA_REQUEST_Participant

public FIPA_REQUEST_Participant()
Method Detail

doBegin

protected void doBegin(CProcessor myProcessor,
                       ACLMessage msg)
Method executed at the beginning of the conversation

Parameters:
myProcessor - the CProcessor managing the conversation
msg - first message assigned to this conversation

doReceiveRequest

protected abstract String doReceiveRequest(CProcessor myProcessor,
                                           ACLMessage request)
Method executed when the initiator receives the request

Parameters:
myProcessor - the CProcessor managing the conversation
request - request message
Returns:

doNotUnderstood

protected void doNotUnderstood(CProcessor myProcessor,
                               ACLMessage messageToSend)
Sets the not-understood message

Parameters:
myProcessor - the CProcessor managing the conversation
messageToSend - not-understood message

doRefuse

protected void doRefuse(CProcessor myProcessor,
                        ACLMessage messageToSend)
Sets the refuse message

Parameters:
myProcessor -
messageToSend -

doAgree

protected void doAgree(CProcessor myProcessor,
                       ACLMessage messageToSend)
Sets the agree message

Parameters:
myProcessor - the CProcessor managing the conversation
messageToSend - agree message

doAction

protected abstract String doAction(CProcessor myProcessor)
Perform the requested action

Parameters:
myProcessor - the CProcessor managing the conversation
Returns:
next conversation state

doFailure

protected void doFailure(CProcessor myProcessor,
                         ACLMessage messageToSend)
Sets the failure message

Parameters:
myProcessor - the CProcessor managing the conversation
messageToSend - failure message

doInform

protected abstract void doInform(CProcessor myProcessor,
                                 ACLMessage response)
Sets the inform message

Parameters:
myProcessor - the CProcessor managing the conversation
response - inform message

doFinal

protected void doFinal(CProcessor myProcessor,
                       ACLMessage messageToSend)
Method executed when the conversation ends

Parameters:
myProcessor - the CProcessor managing the conversation
messageToSend - final message

newFactory

public CFactory newFactory(String name,
                           MessageFilter filter,
                           int availableConversations,
                           CAgent myAgent)
Creates a new participant fipa request factory

Parameters:
name - factory's name
filter - message filter
availableConversations - maximum number of conversation this CFactory can manage simultaneously
myAgent - agent owner of this CFactory
Returns:
a new fipa request participant factory


Copyright © 2012 GTI-IA. All Rights Reserved.