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.states
Class ReplySender
java.lang.Object
  sajas.core.behaviours.Behaviour
      sajas.core.behaviours.SimpleBehaviour
          sajas.core.behaviours.OneShotBehaviour
              sajas.proto.states.ReplySender
All Implemented Interfaces:
jade.util.leap.Serializable, Serializable

public class ReplySender
extends OneShotBehaviour
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.states.ReplySender

Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour
Behaviour.RunnableChangedEvent
Field Summary
static int
NO_REPLY_SENT
Fields inherited from class sajas.core.behaviours.Behaviour
myAgent, myEvent, NOTIFY_DOWN, NOTIFY_UP, parent, STATE_BLOCKED, STATE_READY, STATE_RUNNING
Constructor Summary
protected
ReplySender()
ReplySender(Agent a, String replyKey, String msgKey)
          Constructor.
ReplySender(Agent a, String replyKey, String msgKey, DataStore ds)
          Constructor.
Method Summary
void
action()
          Runs the behaviour.
static void
adjustReply(Agent myAgent, jade.lang.acl.ACLMessage reply, jade.lang.acl.ACLMessage msg)
          Adjust all protocol fields and receivers in a reply to a given message.
int
onEnd()
          This method is just an empty placeholder for subclasses.
void
setMsgKey(String msgKey)
void
setReplyKey(String replyKey)
Methods inherited from class sajas.core.behaviours.OneShotBehaviour
done
Methods inherited from class sajas.core.behaviours.SimpleBehaviour
reset
Methods inherited from class sajas.core.behaviours.Behaviour
actionWrapper, block, block, getAgent, getBehaviourName, getDataStore, getExecutionState, getParent, getRestartCounter, handle, handleBlockEvent, handleRestartEvent, isRunnable, onStart, restart, root, setAgent, setBehaviourName, setDataStore, setExecutionState
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
NO_REPLY_SENT
public static final int NO_REPLY_SENT
See Also:
Constant Field Values
Constructor Detail
ReplySender
public ReplySender(Agent a,
                   String replyKey,
                   String msgKey,
                   DataStore ds)
Constructor.
Parameters:
a - The Agent executing this behaviour
replyKey - DataStore's key where to read the reply message
msgKey - DataStore's key where to read the message to reply to.
ds - the dataStore for this bheaviour

ReplySender
public ReplySender(Agent a,
                   String replyKey,
                   String msgKey)
Constructor.
Parameters:
a - The Agent executing this behaviour
replyKey - DataStore's key where to read the reply message
msgKey - DataStore's key where to read the message to reply to.

ReplySender
protected ReplySender()
Method Detail
action
public void action()
Description copied from class: Behaviour
Runs the behaviour. This abstract method must be implemented by Behavioursubclasses to perform ordinary behaviour duty. An agent schedules its behaviours calling their action() method; since all the behaviours belonging to the same agent are scheduled cooperatively, this method must not enter in an endless loop and should return as soon as possible to preserve agent responsiveness. To split a long and slow task into smaller section, recursive behaviour aggregation may be used.
Overrides:
action in class Behaviour

onEnd
public int onEnd()
Description copied from class: Behaviour
This method is just an empty placeholder for subclasses. It is invoked just once after this behaviour has ended. Therefore, it acts as an epilog for the task represented by this Behaviour.
Note that onEnd is called after the behaviour has been removed from the pool of behaviours to be executed by an agent. Therefore calling reset() is not sufficient to cyclically repeat the task represented by this Behaviour. In order to achieve that, this Behaviour must be added again to the agent (using myAgent.addBehaviour(this)). The same applies to in the case of a Behaviour that is a child of a ParallelBehaviour.
Overrides:
onEnd in class Behaviour
Returns:
an integer code representing the termination value of the behaviour.

setMsgKey
public void setMsgKey(String msgKey)

setReplyKey
public void setReplyKey(String replyKey)

adjustReply
public static void adjustReply(Agent myAgent,
                               jade.lang.acl.ACLMessage reply,
                               jade.lang.acl.ACLMessage msg)
Adjust all protocol fields and receivers in a reply to a given 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