Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

sajas.proto
Class IteratedAchieveREInitiator
java.lang.Object
  sajas.core.behaviours.Behaviour
      sajas.core.behaviours.CompositeBehaviour
          sajas.core.behaviours.SerialBehaviour
              sajas.core.behaviours.FSMBehaviour
                  sajas.proto.AchieveREInitiator
                      sajas.proto.IteratedAchieveREInitiator
All Implemented Interfaces:
jade.util.leap.Serializable, Serializable

public class IteratedAchieveREInitiator
extends AchieveREInitiator
Note: this class has been re-implemented to redirect the use of the agent and behaviour classes to SAJaS versions.
Author:
hlc
See Also:
jade.proto.IteratedAchieveREInitiator

Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
Field Summary
String
ALL_NEXT_REQUESTS_KEY
          Key to retrieve from the DataStore of the behaviour the vector of ACLMessage objects that will be sent at next round.
static String
REINIT
Fields inherited from class sajas.proto.AchieveREInitiator
ALL_INITIATIONS_K, ALL_REQUESTS_KEY, ALL_RESPONSES_KEY, ALL_RESULT_NOTIFICATIONS_KEY, CHECK_AGAIN, CHECK_IN_SEQ, CHECK_SESSIONS, DUMMY_FINAL, HANDLE_AGREE, HANDLE_ALL_RESPONSES, HANDLE_ALL_RESULT_NOTIFICATIONS, HANDLE_FAILURE, HANDLE_INFORM, HANDLE_NOT_UNDERSTOOD, HANDLE_OUT_OF_SEQ, HANDLE_REFUSE, INITIATION_K, PREPARE_INITIATIONS, RECEIVE_REPLY, REPLY_K, REPLY_KEY, replyReceiver, replyTemplate, REQUEST_KEY, SEND_INITIATIONS, sessions
Fields inherited from class sajas.core.behaviours.FSMBehaviour
currentName, lastStates
Fields inherited from class sajas.core.behaviours.CompositeBehaviour
currentExecuted
Fields inherited from class sajas.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
Constructor Summary
IteratedAchieveREInitiator(Agent a, jade.lang.acl.ACLMessage msg)
          Construct an IteratedAchieveREInitiator with an empty DataStore
IteratedAchieveREInitiator(Agent a, jade.lang.acl.ACLMessage msg, DataStore store)
          Construct an IteratedAchieveREInitiator with a given DataStore
Method Summary
protected sajas.proto.Initiator.ProtocolSession
getSession(jade.lang.acl.ACLMessage msg, int sessionIndex)
          Return a ProtocolSession object to manage replies to a given initiation message
protected void
handleAllResultNotifications(Vector resultNotifications)
          This method is redefined to call the proper overloaded method
protected void
handleAllResultNotifications(Vector resultNotifications, Vector nextRequests)
          This method is called when all the result notification messages of the current round have been collected.
protected void
handleInform(jade.lang.acl.ACLMessage inform)
          This method is redefined to call the proper overloaded method
protected void
handleInform(jade.lang.acl.ACLMessage inform, Vector nextRequests)
          This method is called every time an inform message is received, which is not out-of-sequence according to the protocol rules.
protected void
initializeDataStore(jade.lang.acl.ACLMessage msg)
          Initialize the data store.
static boolean
isSessionTerminated(jade.lang.acl.ACLMessage inform)
          Check if the responder has closed the session just after sending this inform message.
protected void
prepareForNextRound()
void
registerHandleAllResultNotifications(Behaviour b)
          This method allows to register a user defined Behaviour in the HANDLE_ALL_RESULT_NOTIFICATIONS state.
void
registerHandleInform(Behaviour b)
          This method allows to register a user defined Behaviour in the HANDLE_REFUSE state.
Methods inherited from class sajas.proto.AchieveREInitiator
adjustReplyTemplate, checkInSequence, checkSessions, createConvId, getToBeReset, handleAgree, handleAllResponses, handleFailure, handleNotUnderstood, handleOutOfSequence, handleRefuse, onStart, prepareInitiations, prepareRequests, registerHandleAgree, registerHandleAllResponses, registerHandleFailure, registerHandleNotUnderstood, registerHandleOutOfSequence, registerHandleRefuse, registerPrepareInitiations, registerPrepareRequests, reinit, reset, reset, sendInitiations, setDataStore
Methods inherited from class sajas.core.behaviours.FSMBehaviour
checkTermination, deregisterDefaultTransition, deregisterState, deregisterTransition, forceTransitionTo, getChildren, getCurrent, getLastExitValue, getName, getPrevious, getState, handleInconsistentFSM, handleStateEntered, hasDefaultTransition, onEnd, registerDefaultTransition, registerDefaultTransition, registerFirstState, registerLastState, registerState, registerTransition, registerTransition, resetStates, scheduleFirst, scheduleNext, stringifyTransitionTable
Methods inherited from class sajas.core.behaviours.SerialBehaviour
handle
Methods inherited from class sajas.core.behaviours.CompositeBehaviour
action, done, handleBlockEvent, handleRestartEvent, registerAsChild, resetChildren, setAgent
Methods inherited from class sajas.core.behaviours.Behaviour
actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, isRunnable, restart, root, setBehaviourName, setExecutionState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
ALL_NEXT_REQUESTS_KEY
public final String ALL_NEXT_REQUESTS_KEY
Key to retrieve from the DataStore of the behaviour the vector of ACLMessage objects that will be sent at next round.

REINIT
public static final String REINIT
See Also:
Constant Field Values
Constructor Detail
IteratedAchieveREInitiator
public IteratedAchieveREInitiator(Agent a,
                                  jade.lang.acl.ACLMessage msg)
Construct an IteratedAchieveREInitiator with an empty DataStore

IteratedAchieveREInitiator
public IteratedAchieveREInitiator(Agent a,
                                  jade.lang.acl.ACLMessage msg,
                                  DataStore store)
Construct an IteratedAchieveREInitiator with a given DataStore
Parameters:
a - The agent performing the protocol
msg - The message that must be used to initiate the protocol. Notice that the default implementation of the prepareRequest() method returns an array composed of only this message. The values of the slot reply-with is ignored and a different value is assigned automatically by this class for each receiver.
store - The DataStore that will be used by this AchieveREInitiator
Method Detail
prepareForNextRound
protected void prepareForNextRound()

initializeDataStore
protected void initializeDataStore(jade.lang.acl.ACLMessage msg)
Description copied from class: AchieveREInitiator
Initialize the data store.
Overrides:
initializeDataStore in class AchieveREInitiator

getSession
protected sajas.proto.Initiator.ProtocolSession getSession(jade.lang.acl.ACLMessage msg,
                                                           int sessionIndex)
Return a ProtocolSession object to manage replies to a given initiation message
Overrides:
getSession in class AchieveREInitiator

handleInform
protected void handleInform(jade.lang.acl.ACLMessage inform,
                            Vector nextRequests)
This method is called every time an inform message is received, which is not out-of-sequence according to the protocol rules. This default implementation does nothing; programmers might wish to override this method in case they need to react to this event.
Parameters:
inform - the received inform message

handleInform
protected final void handleInform(jade.lang.acl.ACLMessage inform)
This method is redefined to call the proper overloaded method
Overrides:
handleInform in class AchieveREInitiator
Parameters:
inform - the received inform message

handleAllResultNotifications
protected void handleAllResultNotifications(Vector resultNotifications,
                                            Vector nextRequests)
This method is called when all the result notification messages of the current round have been collected. By result notification message we intend here all the inform, failure received messages, which are not out-of-sequence according to the protocol rules. This default implementation does nothing; programmers might wish to override this method in case they need to react to this event by analysing all the messages in just one call.

handleAllResultNotifications
protected final void handleAllResultNotifications(Vector resultNotifications)
This method is redefined to call the proper overloaded method
Overrides:
handleAllResultNotifications in class AchieveREInitiator

registerHandleInform
public void registerHandleInform(Behaviour b)
This method allows to register a user defined Behaviour in the HANDLE_REFUSE state. This behaviour would override the homonymous method. This method also set the data store of the registered Behaviour to the DataStore of this current behaviour. The registered behaviour can retrieve the received inform ACLMessage object from the datastore at the REPLY_KEY key and the Vector of ACLMessage objects to be sent at next round at the ALL_NEXT_REQUESTS_KEY.
Overrides:
registerHandleInform in class AchieveREInitiator
Parameters:
b - the Behaviour that will handle this state

registerHandleAllResultNotifications
public void registerHandleAllResultNotifications(Behaviour b)
This method allows to register a user defined Behaviour in the HANDLE_ALL_RESULT_NOTIFICATIONS state. This behaviour would override the homonymous method. This method also set the data store of the registered Behaviour to the DataStore of this current behaviour. The registered behaviour can retrieve the Vector of ACLMessage objects, received as a result notification, from the datastore at the ALL_RESULT_NOTIFICATIONS_KEY key and the Vector of ACLMessage objects to be sent at next round at the ALL_NEXT_REQUESTS_KEY.
Overrides:
registerHandleAllResultNotifications in class AchieveREInitiator
Parameters:
b - the Behaviour that will handle this state

isSessionTerminated
public static boolean isSessionTerminated(jade.lang.acl.ACLMessage inform)
Check if the responder has closed the session just after sending this inform message.

Overview  Package   Class  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Java API documentation generated with DocFlex/Doclet 1.6.1 using JavadocPro template set.
DocFlex/Doclet is both a multi-format Javadoc doclet and a free edition of DocFlex/Javadoc, which is a template-driven programming tool for rapid development of any Javadoc-based Java API documentation generators (i.e. doclets). If you need to customize your Javadoc without writing a full-blown doclet from scratch, DocFlex/Javadoc may be the only tool able to help you! Find out more at www.docflex.com