CoPS.agents
Class TaskResponsibleResponseBehaviour

java.lang.Object
  extended bySimpleBehaviour
      extended byCoPS.agents.TaskResponsibleResponseBehaviour

public class TaskResponsibleResponseBehaviour
extends SimpleBehaviour

This class represents a behaviour returning a state describing how the problem solvig process went. Modified by Kari Roessland: The class is separated from the CoPSTaskResponsibleClass. And it is modified so that the return message - containing the solution to the problem is placed in the right datastore with the right KEY. In the previous working this message was never returned.

See Also:
Serialized Form

Constructor Summary
TaskResponsibleResponseBehaviour(Agent agent, DataStore ds, Behaviour topBehaviour)
          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

TaskResponsibleResponseBehaviour

public TaskResponsibleResponseBehaviour(Agent agent,
                                        DataStore ds,
                                        Behaviour topBehaviour)
The constructor. Modified by Kari Roessland.

Parameters:
agent - The owner of the behaviour.
ds - The datastore to be set in this behaviour.
topBehaviour - The Behviour where this one was added to the behaviour-pool.
Method Detail

action

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


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 or false, depending on if the behaviour is done or not.

onEnd

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

Returns:
The transition from this behaviour.