CoPS.agents
Class RespondToCfpsBehaviour

java.lang.Object
  extended byContractNetResponder
      extended byCoPS.agents.RespondToCfpsBehaviour

public class RespondToCfpsBehaviour
extends ContractNetResponder

Class taking care of the correspondence between an agent sending out cfps and this problem solver. Modified by Kari Roessland.

See Also:
Serialized Form

Constructor Summary
RespondToCfpsBehaviour(Agent agent, MessageTemplate template, DataStore ds)
          The constructor only calls the RespondToCfpsBehaviour class' superconstructor.
 
Method Summary
protected  void handleRejectProposal(ACLMessage cfp, ACLMessage propose, ACLMessage rejectProposal)
          The method handleRejectProposal is called when an reject-proposal-message is received, the agent did not get an invitation to join the problem solving team.
 int onEnd()
          This method returns the transition from this state/behaviour.
protected  ACLMessage prepareResponse(ACLMessage request)
          The method prepareResponse handles the making of an answer to a cfp-message.
protected  ACLMessage prepareResultNotification(ACLMessage cfp, ACLMessage propose, ACLMessage accept)
          The method prepareResultNotification is called when an accept-message is received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RespondToCfpsBehaviour

public RespondToCfpsBehaviour(Agent agent,
                              MessageTemplate template,
                              DataStore ds)
The constructor only calls the RespondToCfpsBehaviour class' superconstructor. Modfied by Kari Roessland.

Parameters:
agent - The owner of this behaviour.
template - A message template used to filter the correct cfp-messages.
ds - The datastore belonging to this behaviour.
Method Detail

prepareResponse

protected ACLMessage prepareResponse(ACLMessage request)
The method prepareResponse handles the making of an answer to a cfp-message. The agent makes a proposal to the incoming cfp-message. Modfied by Kari Roessland.

Parameters:
request - The incoming cfp message.
Returns:
A message which is the response to the incoming cfp message.

handleRejectProposal

protected void handleRejectProposal(ACLMessage cfp,
                                    ACLMessage propose,
                                    ACLMessage rejectProposal)
The method handleRejectProposal is called when an reject-proposal-message is received, the agent did not get an invitation to join the problem solving team. Added by Kari Roessland.

Parameters:
cfp - The cfp message.
propose - The agent's proposal message.
rejectProposal - The received reject-proposal message.

prepareResultNotification

protected ACLMessage prepareResultNotification(ACLMessage cfp,
                                               ACLMessage propose,
                                               ACLMessage accept)
The method prepareResultNotification is called when an accept-message is received. The result states if an agent wants to join the team or not. Modfied by Kari Roessland.

Parameters:
cfp - The cfp message.
propose - The agent's proposal message.
accept - The invitation/rejection message received from the Task Responsible agent.
Returns:
A message saying if the agent wants to join the team or not (only if an invitation message was received).

onEnd

public int onEnd()
This method returns the transition from this state/behaviour.

Returns:
The final transition