Behaviour

class mobrob_behcon.behaviours.behaviour.Behaviour(name)[source]

The abstract class Behaviour

Attributes

name

Name of behaviour

resolver

resolver

percept_space

percept_space

priority

priority of behaviour

current_beh_group

current active behaviour group

Methods

__init__(name)

Constructor

add_desire(desire)

Send desire to resolver.

error([code])

Raise an error about the behaviour.

fire()

Abstract method which will be called in the cyclic polling loop from resolver.

set_current_beh_group(beh_group)

Set current active behaviourgroup

set_percept_space(percept_space)

Set the reference to percept_space

set_priority(priority)

Set current priority of the behaviour, can be changed during runtime

set_resolver(resolver)

Set the reference to resolver

success([code])

Set the behaviour as successful ended.

Details

__init__(name)[source]

Constructor

Parameters

name (string) – name or behaviour

add_desire(desire)[source]

Send desire to resolver.

Parameters

desire (Desire) – a desire to be added to the resolver

error(code=0)[source]

Raise an error about the behaviour. With the error code some more information about the error can be given to the behaviourgroup

Parameters

code (int, optional) – error code, defaults to 0

abstract fire()[source]

Abstract method which will be called in the cyclic polling loop from resolver.

Needs to be defined by inherited classes.

In this method you can call the function add_desire() to send a desire to the resolver. Depending on strength and priority this will be forwarded to actuators

set_current_beh_group(beh_group)[source]

Set current active behaviourgroup

Parameters

beh_group (BehaviourGroup) – the currently active behaviour group

set_percept_space(percept_space)[source]

Set the reference to percept_space

Parameters

percept_space (PerceptualSpace) – relevant percept_space object

set_priority(priority)[source]

Set current priority of the behaviour, can be changed during runtime

Parameters

priority ([type]) – [description]

set_resolver(resolver)[source]

Set the reference to resolver

Parameters

resolver (Resolver) – relevant resolver object

success(code=0)[source]

Set the behaviour as successful ended. With the success code some more information about the success can be given to the behaviourgroup

Parameters

code (int, optional) – success code, defaults to 0