teamSpace.agent
Class PrepareResultBehaviour

java.lang.Object
  extended bySimpleBehaviour
      extended byteamSpace.agent.PrepareResultBehaviour

public class PrepareResultBehaviour
extends SimpleBehaviour

This behaviour is the last behaviour (state) in the FSMBehaviour (final-state-machine) described by the class TeamSpacePSBehaviour. If this state is reached the problem solving in the Team Space was successfull. The solution of the initial problem is plased in the datastore used by the TeamSpaceAgentBehaviour, and is therefor the response in the request-protocol defined by the TeamSpaceAgentBehaviour.

See Also:
Serialized Form

Constructor Summary
PrepareResultBehaviour(Agent agent, DataStore ds, Behaviour topBehaviour, java.lang.String teamID)
          The constructor
 
Method Summary
 void action()
          The action method prepares and put the result/solution in the proper datastore; the datastore of the HandleProblemSolvingRequestBehaviour.
 boolean done()
          The agent scheduler calls this method to see whether a Behaviour still need to be run or it has completed its task.
 int onEnd()
          This method is called when the behaviour has finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrepareResultBehaviour

public PrepareResultBehaviour(Agent agent,
                              DataStore ds,
                              Behaviour topBehaviour,
                              java.lang.String teamID)
The constructor

Parameters:
agent - The agent which get this behaviour
ds - The DataStore used in this behaviour
topBehaviour - A link to the Behaviour which defines the request protocol that this behaviour is a part of
Method Detail

action

public void action()
The action method prepares and put the result/solution in the proper datastore; the datastore of the HandleProblemSolvingRequestBehaviour.


done

public boolean done()
The agent scheduler calls this method to see whether a Behaviour still need to be run or it has completed its task. Concrete behaviours must implement this method to return their completion state. Finished behaviours are removed from the scheduling queue, while others are kept within to be run again when their turn comes again.

Returns:
true if the behaviour is done and false if not

onEnd

public int onEnd()
This method is called when the behaviour has finished.

Returns:
The transition from this behaviour (state)