|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectes.upv.dsic.gti_ia.architecture.FIPAContractNetResponder
public class FIPAContractNetResponder
This class implements the FIPA-Contract-Net interaction protocol, Role Responder
| Field Summary | |
|---|---|
QueueAgent |
myAgent
|
| Constructor Summary | |
|---|---|
FIPAContractNetResponder(QueueAgent _agent,
MessageTemplate _template)
Creates a new FIPA-Contract-Net interaction protocol, rol responder. |
|
| Method Summary | |
|---|---|
void |
action()
Runs the state machine with the communication protocol |
QueueAgent |
getQueueAgent()
Returns the agent. |
protected void |
handleAcceptProposal(ACLMessage cfp,
ACLMessage propose,
ACLMessage accept)
This method is called when ACCEPT-PROPOSAL is received from the initiator. |
protected void |
handleRejectProposal(ACLMessage cfp,
ACLMessage propose,
ACLMessage reject)
This method is called when REJECT-PROPOSAL is received from the initiator. |
protected ACLMessage |
prepareResponse(ACLMessage cfp)
This method is called when the initiator's message is received that matches the message template passed in the constructor. |
protected ACLMessage |
prepareResultNotification(ACLMessage cfp,
ACLMessage propose,
ACLMessage accept)
This method is called after the response has been sent and only when one of the following two cases arise: the response was an agree message OR no response message was sent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public QueueAgent myAgent
| Constructor Detail |
|---|
public FIPAContractNetResponder(QueueAgent _agent,
MessageTemplate _template)
agent - is the reference to the Agent Objecttemplate - is a MessageTemplate, will serve as a filter for receiving the right message| Method Detail |
|---|
public QueueAgent getQueueAgent()
public void action()
protected ACLMessage prepareResponse(ACLMessage cfp)
throws NotUnderstoodException,
RefuseException
cfp - initial CFP message
NotUnderstoodException
RefuseException
protected ACLMessage prepareResultNotification(ACLMessage cfp,
ACLMessage propose,
ACLMessage accept)
throws FailureException
cfp - initial CFP messagepropose - propose messageaccept - accept message
FailureException
protected void handleRejectProposal(ACLMessage cfp,
ACLMessage propose,
ACLMessage reject)
cfp - initial CFP messagepropose - the PROPOSE message sent back as reply to the initial CFP
messagereject - the received REJECT_PROPOSAL message
protected void handleAcceptProposal(ACLMessage cfp,
ACLMessage propose,
ACLMessage accept)
cfp - initial CFP messagepropose - the PROPOSE message sent back as reply to the initial CFP
messageaccept - the received ACCEPT_PROPOSAL message.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||