|
Nested classes/interfaces inherited from class sajas.core.behaviours.Behaviour |
Behaviour.RunnableChangedEvent |
Field Summary | ||
protected String |
ALL_INITIATIONS_K key to retrieve from the DataStore of the behaviour the vector of PROPOSE ACLMessage objects that have to be sent. |
|
String |
ALL_RESPONSES_KEY key to retrieve from the DataStore of the behaviour the vector of ACLMessage objects that have been received as responses. |
|
protected static String |
CHECK_IN_SEQ | |
protected static String |
CHECK_SESSIONS | |
protected static String |
DUMMY_FINAL | |
protected static String |
HANDLE_ACCEPT_PROPOSAL | |
protected static String |
HANDLE_ALL_RESPONSES | |
protected static String |
HANDLE_NOT_UNDERSTOOD | |
protected static String |
HANDLE_OUT_OF_SEQ | |
protected static String |
HANDLE_REJECT_PROPOSAL | |
protected String |
INITIATION_K key to retrieve from the DataStore of the behaviour the ACLMessage object passed in the constructor of the class. |
|
protected static String |
PREPARE_INITIATIONS | |
protected static String |
RECEIVE_REPLY | |
String |
REPLY_KEY key to retrieve from the DataStore of the behaviour the last ACLMessage object that has been received (null if the timeout expired). |
|
protected MsgReceiver |
replyReceiver | |
protected jade.lang.acl.MessageTemplate |
replyTemplate | |
protected static String |
SEND_INITIATIONS | |
protected jade.util.leap.Map |
sessions | |
protected String[] |
toBeReset |
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 | ||
ProposeInitiator(Agent a, jade.lang.acl.ACLMessage msg) Construct a ProposeInitiator with an empty DataStore |
||
ProposeInitiator(Agent a, jade.lang.acl.ACLMessage initiation, DataStore store) Construct a ProposeInitiator with a given DataStore |
Method Summary | ||
protected void |
adjustReplyTemplate(jade.lang.acl.ACLMessage msg) | |
protected boolean |
checkInSequence(jade.lang.acl.ACLMessage reply) Check whether a reply is in-sequence and update the appropriate Session. |
|
protected int |
checkSessions(jade.lang.acl.ACLMessage reply) Check the status of the sessions after the reception of the last reply or the expiration of the timeout. |
|
protected String |
createConvId(Vector msgs) Create a new conversation identifier to begin a new interaction. |
|
protected void |
handleAcceptProposal(jade.lang.acl.ACLMessage accept_proposal) This method is called every time an accept-proposal message is received, which is not out-of-sequence according to the protocol rules. |
|
protected void |
handleAllResponses(Vector responses) This method is called when all the responses have been collected or when the timeout is expired. |
|
protected void |
handleNotUnderstood(jade.lang.acl.ACLMessage notUnderstood) This method is called every time a not-understood message is received, which is not out-of-sequence according to the protocol rules. |
|
protected void |
handleOutOfSequence(jade.lang.acl.ACLMessage msg) This method is called every time a message is received, which is out-of-sequence according to the protocol rules. |
|
protected void |
handleRejectProposal(jade.lang.acl.ACLMessage reject_proposal) This method is called every time an reject-proposal 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. |
|
void |
onStart() Override the onStart() method to initialize the vectors that will keep all the replies in the data store. |
|
protected Vector |
prepareInitiations(jade.lang.acl.ACLMessage propose) This method must return the vector of ACLMessage objects to be sent. |
|
void |
registerHandleAcceptProposal(Behaviour b) This method allows to register a user defined Behaviour in the HANDLE_ACCEPT_PROPOSAL state. |
|
void |
registerHandleAllResponses(Behaviour b) This method allows to register a user defined Behaviour in the HANDLE_ALL_RESPONSES state. |
|
void |
registerHandleNotUnderstood(Behaviour b) This method allows to register a user defined Behaviour in the HANDLE_NOT_UNDERSTOOD state. |
|
void |
registerHandleOutOfSequence(Behaviour b) This method allows to register a user defined Behaviour in the HANDLE_OUT_OF_SEQ state. |
|
void |
registerHandleRejectProposal(Behaviour b) This method allows to register a user defined Behaviour in the HANDLE_REJECT_PROPOSAL state. |
|
void |
reset() reset this behaviour by putting a null ACLMessage as message to be sent |
|
void |
reset(jade.lang.acl.ACLMessage msg) reset this behaviour |
|
protected void |
sendInitiations(Vector initiations) Create and initialize the Sessions and sends the initiation messages. |
|
void |
setDataStore(DataStore ds) Override the setDataStore() method to initialize propagate this setting to all children. |
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 |
ProposeInitiator
with an empty DataStoreProposeInitiator
with a given DataStoreprepareInitiations()
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.DataStore
that will be used by this
ProposeInitiator
reply-with
is ignored and regenerated automatically
by this class.accept-proposal
message is received, which is not out-of-sequence according
to the protocol rules.
This default implementation does nothing; programmers might
wish to override the method in case they need to react to this event.reject-proposal
message is received, which is not out-of-sequence according
to the protocol rules.
This default implementation does nothing; programmers might
wish to override the method in case they need to react to this event.not-understood
message is received, which is not out-of-sequence according
to the protocol rules.
This default implementation does nothing; programmers might
wish to override the method in case they need to react to this event.Behaviour
in the HANDLE_ALL_RESPONSES 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 response,
from the datastore at the ALL_RESPONSES_KEY
key.Behaviour
in the HANDLE_ACCEPT_PROPOSAL 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 inform
ACLMessage object received
from the datastore at the REPLY_KEY
key.Behaviour
in the HANDLE_REJECT_PROPOSAL 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 inform
ACLMessage object received
from the datastore at the REPLY_KEY
key.Behaviour
in the HANDLE_NOT_UNDERSTOOD 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 not-understood
ACLMessage object received
from the datastore at the REPLY_KEY
key.Behaviour
in the HANDLE_OUT_OF_SEQ 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 out of sequence
ACLMessage object received
from the datastore at the REPLY_KEY
key.replyBy
of all the sent messages.
By response message we intend here all the accept-proposal,
reject-proposal, not-understood
received messages, which are not
not out-of-sequence according to the protocol rules.
This default implementation does nothing; programmers might
wish to override the method in case they need to react to this event
by analysing all the messages in just one call.DataStore
that this Behaviour
will use as its private data store:conversation-id
slot, its value is
used, else a new conversation identifier is generated.
|