CoPS.agents
Class HandleProblemSolvingRequestsBehaviour

java.lang.Object
  extended byAchieveREResponder
      extended byCoPS.agents.HandleProblemSolvingRequestsBehaviour

public class HandleProblemSolvingRequestsBehaviour
extends AchieveREResponder

This class represents the behaviour describing what to do when getting an ACL message with a problem solving request. Modified by Kari Roessland. The prepareResultNotification state of the AchieveREResponder protocol is taken care of by a new behaviour: PrepareResultBehaviour. By using the method registerPrepareResultNotification the datastore of this behaviour is set in our PrepareResultBehaviour. It is responsibility of this behaviour to put into the datastore (bound at the right key) the proper ACLMessage object to be sent by this responder. The proper key is RESULT_NOTIFICATION_KEY.

See Also:
Serialized Form

Constructor Summary
HandleProblemSolvingRequestsBehaviour(Agent agent, MessageTemplate messageTemplate)
          The constructor
 
Method Summary
 int onEnd()
          Information from the last execution of this behaviour is reset and the behaviour is added to the agent again.
protected  ACLMessage prepareResponse(ACLMessage request)
          In this method the agent informs the requester of the problem solving if it is willing to try solving the problem or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandleProblemSolvingRequestsBehaviour

public HandleProblemSolvingRequestsBehaviour(Agent agent,
                                             MessageTemplate messageTemplate)
The constructor

Parameters:
agent - the owner of this behaviour
Method Detail

prepareResponse

protected ACLMessage prepareResponse(ACLMessage request)
In this method the agent informs the requester of the problem solving if it is willing to try solving the problem or not. If the agent will try to come up with a solution it returns an agree message, else it returns a not-understood message. Modified by Kari Roessland.

Parameters:
request - The request message.
Returns:
The response message to the request message.

onEnd

public int onEnd()
Information from the last execution of this behaviour is reset and the behaviour is added to the agent again. Modified by Kari Roessland.

Returns:
The transition from this behaviour.