17 namespace behaviourcontrol
47 std::vector<Behaviour*> inhibits;
48 std::vector<Behaviour*> isInhibitedBy;
Implements a single behaviour.
Definition: behaviour.h:26
int ret_t
Used to represent an error code/function return value.
Definition: behaviour_common.h:142
const std::string name
Human-friendly string name of the behaviour.
Definition: behaviour.h:42
std::string getUniqueName(const BehaviourLayer *LBase) const
Returns a unique behaviour name.
Definition: behaviour.cpp:94
virtual void inhibited()
A callback for the behaviour object that is invoked instead of execute() when the behaviour is deacti...
Definition: behaviour.h:58
BehaviourLayer *const LBase
Pointer to the parent behaviour layer.
Definition: behaviour.h:39
Implements a single behaviour layer.
Definition: behaviour_layer.h:26
Signals successful execution of a function, with no error conditions encountered. ...
Definition: behaviour_common.h:69
BehaviourManager *const MBase
Pointer to the parent behaviour manager.
Definition: behaviour.h:38
const std::string Lname
Human-friendly string name of the parent behaviour layer.
Definition: behaviour.h:41
level_t getA() const
Returns the current true activation level of the behaviour. The return value is valid only when calle...
Definition: behaviour.h:67
std::size_t index_t
Used to represent an array or vector index (must be an unsigned type)
Definition: behaviour_common.h:140
virtual void execute()
Execute callback for the behaviour object. This function is called from BehaviourLayer::executeAll()...
Definition: behaviour.h:57
virtual ret_t init()
Initialisation callback for the behaviour. This function is called from BehaviourLayer::initAll(), and is intended to be overridden for the purpose of initialising the derived behaviour object.
Definition: behaviour.h:52
Behaviour * getBasePtr()
Return a pointer to the underlying Behaviour class object in the case of a derived behaviour class...
Definition: behaviour.h:77
static const index_t DEF_ILIST_CAPACITY
Default capacity of the inhibition lists that are used to store which behaviours are inhibitors and i...
Definition: behaviour.h:30
Implements a single behaviour manager.
Definition: behaviour_manager.h:27
virtual ~Behaviour()
Behaviour object destructor.
Definition: behaviour.cpp:52
const std::string nullString
Used to avoid the need for null string literals throughout the code.
Definition: behaviour_common.h:148
bool wasJustActivated() const
Returns true when called from the execute() callback, and the behaviour was just activated. The return value is always true when called from inhibited().
Definition: behaviour.h:59
bool wasJustDeactivated() const
Returns true when called from the inhibited() callback, and the behaviour was just inhibited...
Definition: behaviour.h:60
const std::string Mname
Human-friendly string name of the parent behaviour manager.
Definition: behaviour.h:40
virtual level_t computeActivationLevel()
Callback for the computation of the raw behaviour activation level. Valid return values are false...
Definition: behaviour.h:69
virtual void update()
Update callback for the behaviour object. This function is called from BehaviourLayer::updateAll(), which is used in BehaviourLayer::step().
Definition: behaviour.h:56
float level_t
Used to represent an activation level (raw activation levels should always be in the range [0...
Definition: behaviour_common.h:141
Behaviour(BehaviourLayer *LBase, const std::string &name=nullString)
Default constructor.
Definition: behaviour.cpp:29
Common definitions include file for the internal Behaviour Control Framework source code...
static const std::string DEF_BEHAVIOUR_NAME
Default behaviour name used to generate a unique one, in the case that no name is provided by a deriv...
Definition: behaviour.h:31