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

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

public abstract class FIPA_RECRUITING_Participant
extends Object

Template for CFactories that manage fipa recruiting 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

Field Summary
static String AGREE
           
static String BEGIN
           
static String FAILURE_NO_MATCH
           
static String FAILURE_PROXY
           
static String FINAL_RECRUITING_PARTICIPANT
           
static String INFORM
           
static String LOCATE_AGENTS
           
static String RECEIVE_PROXY
           
static String REFUSE
           
static String START_SUB_PROTOCOL
           
 
Constructor Summary
FIPA_RECRUITING_Participant()
           
 
Method Summary
protected  void doAgree(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the agree message to a proxy action
protected  void doBegin(CProcessor myProcessor, ACLMessage msg)
          Method executed at the beginning of the conversation
protected  void doFailureNoMatch(CProcessor myProcessor, ACLMessage messageToSend)
          Method to execute when there is no agents to recruit
protected  void doFailureProxy(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the failure message
protected  void doFinalRecruitingParticipant(CProcessor myProcessor, ACLMessage messageToSend)
          End of the conversation
protected  void doInform(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the inform message
protected abstract  ArrayList<AgentID> doLocateAgents(CProcessor myProcessor, ACLMessage proxyMessage)
          Locate agents to recruit
protected abstract  String doReceiveProxy(CProcessor myProcessor, ACLMessage msg)
          Method executed when the participant receive a message to proxy
protected  void doRefuse(CProcessor myProcessor, ACLMessage messageToSend)
          Sets the refuse message to a proxy action
 CFactory newFactory(String name, MessageFilter filter, ACLMessage template, int availableConversations, CAgent myAgent)
          Creates a new participant fipa recruiting CFactory
protected abstract  boolean resultOfSubProtocol(CProcessor myProcessor, ACLMessage subProtocolMessageResult)
          Returns the result of a proxy action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEGIN

public static String BEGIN

RECEIVE_PROXY

public static String RECEIVE_PROXY

REFUSE

public static String REFUSE

AGREE

public static String AGREE

LOCATE_AGENTS

public static String LOCATE_AGENTS

FAILURE_NO_MATCH

public static String FAILURE_NO_MATCH

START_SUB_PROTOCOL

public static String START_SUB_PROTOCOL

FAILURE_PROXY

public static String FAILURE_PROXY

INFORM

public static String INFORM

FINAL_RECRUITING_PARTICIPANT

public static String FINAL_RECRUITING_PARTICIPANT
Constructor Detail

FIPA_RECRUITING_Participant

public FIPA_RECRUITING_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

doReceiveProxy

protected abstract String doReceiveProxy(CProcessor myProcessor,
                                         ACLMessage msg)
Method executed when the participant receive a message to proxy

Parameters:
myProcessor - the CProcessor managing the conversation
msg - proxy message
Returns:
next conversation state

doRefuse

protected void doRefuse(CProcessor myProcessor,
                        ACLMessage messageToSend)
Sets the refuse message to a proxy action

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

doAgree

protected void doAgree(CProcessor myProcessor,
                       ACLMessage messageToSend)
Sets the agree message to a proxy action

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

doLocateAgents

protected abstract ArrayList<AgentID> doLocateAgents(CProcessor myProcessor,
                                                     ACLMessage proxyMessage)
Locate agents to recruit

Parameters:
myProcessor - the CProcessor managing the conversation
proxyMessage - proxy message sent by the initiator
Returns:
next conversation state

doFailureNoMatch

protected void doFailureNoMatch(CProcessor myProcessor,
                                ACLMessage messageToSend)
Method to execute when there is no agents to recruit

Parameters:
myProcessor - the CProcessor managing the conversation
messageToSend - no match message

resultOfSubProtocol

protected abstract boolean resultOfSubProtocol(CProcessor myProcessor,
                                               ACLMessage subProtocolMessageResult)
Returns the result of a proxy action

Parameters:
myProcessor - the CProcessor managing the conversation
subProtocolMessageResult - result of the subprotocol
Returns:
next conversation message

doFailureProxy

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

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

doInform

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

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

doFinalRecruitingParticipant

protected void doFinalRecruitingParticipant(CProcessor myProcessor,
                                            ACLMessage messageToSend)
End of the conversation

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

newFactory

public CFactory newFactory(String name,
                           MessageFilter filter,
                           ACLMessage template,
                           int availableConversations,
                           CAgent myAgent)
Creates a new participant fipa recruiting CFactory

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


Copyright © 2012 GTI-IA. All Rights Reserved.