Class CompositeBehaviour

java.lang.Object
  |
  +--jade.core.behaviours.Behaviour
        |
        +--jade.core.behaviours.CompositeBehaviour
All Implemented Interfaces:
java.io.Serializable, Serializable
Direct Known Subclasses:
ParallelBehaviour, SerialBehaviour

public abstract class CompositeBehaviour extends Behaviour

An abstract superclass for behaviours composed by many parts. This class holds inside a number of children behaviours. When a CompositeBehaviour receives it execution quantum from the agent scheduler, it executes one of its children according to some policy. This class must be extended to provide the actual scheduling policy to apply when running children behaviours.

 

 

Version:
$Date: 2008-10-08 15:14:15 +0200 (mer, 08 ott 2008) $ $Revision: 6050 $
Author:
Giovanni Rimassa - Universita' di Parma, Giovanni Caire - TILAB
See Also:
SequentialBehaviour, ParallelBehaviour, FSMBehaviour, Serialized Form

Field Summary
 
Fields inherited from class jade.core.behaviours.Behaviour
myAgent
 
Constructor Summary
protected CompositeBehaviour()
          Default constructor, does not set the owner agent.
protected CompositeBehaviour(Agent a)
          This constructor sets the owner agent.
 
Method Summary
 voidaction()
          Executes this CompositeBehaviour.
protected abstract  booleancheckTermination(boolean currentDone, int currentResult)
          This methods is called after the execution of each child in order to check whether the CompositeBehaviour should terminate.
 booleandone()
          Checks whether this behaviour has terminated.
abstract  CollectiongetChildren()
          This method returns a Collection view of the children of this CompositeBehaviour
protected abstract  BehaviourgetCurrent()
          This method returns the child behaviour currently scheduled for execution
 voidreset()
          Puts a CompositeBehaviour back in initial state.
protected  voidresetChildren()
           
protected abstract  voidscheduleFirst()
          This method schedules the first child to be executed
protected abstract  voidscheduleNext(boolean currentDone, int currentResult)
          This method schedules the next child to be executed
 voidsetAgent(Agent a)
          Associates this behaviour with the agent it belongs to.
 
Methods inherited from class jade.core.behaviours.Behaviour
block, block, getBehaviourName, getDataStore, getParent, isRunnable, onEnd, onStart, restart, root, setBehaviourName, setDataStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值