CoPS.agents
Class ComposePSMBehaviour

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

public class ComposePSMBehaviour
extends AchieveREResponder

This class assist the task responsible agent in composing partial results connected to a psm

See Also:
Serialized Form

Constructor Summary
ComposePSMBehaviour(Agent agent, MessageTemplate template)
          The constructor only calls the super-constructor
 
Method Summary
 int onEnd()
          Information from the last execution of this behaviour is reset.
protected  ACLMessage prepareResponse(ACLMessage request)
          In this method the agent desides if it can perform the action and prepares a response to the incoming request message.
protected  ACLMessage prepareResultNotification(ACLMessage request, ACLMessage response)
          The agent prepares the output from the action and returns it to the requester (TeamSpaceAgent).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComposePSMBehaviour

public ComposePSMBehaviour(Agent agent,
                           MessageTemplate template)
The constructor only calls the super-constructor

Parameters:
agent - The owner of this behaviour
template - A message template that defines the construct of the incoming request message.
Method Detail

prepareResponse

protected ACLMessage prepareResponse(ACLMessage request)
In this method the agent desides if it can perform the action and prepares a response to the incoming request message.

Parameters:
request - The incoming request message.

prepareResultNotification

protected ACLMessage prepareResultNotification(ACLMessage request,
                                               ACLMessage response)
The agent prepares the output from the action and returns it to the requester (TeamSpaceAgent).

Parameters:
request - The request message.
response - The response message to the request message, that was sent before.
Returns:
An inform message or a failure message.

onEnd

public int onEnd()
Information from the last execution of this behaviour is reset. Checks if the composed PSM is the last one. If it is - do not wait for any more PSMs, else add this behaviour to the agent's behaviour pool once more (keep waiting for new PSMs to compose).

Returns:
The transition from this state/behaviour.