Strategy

class mobrob_behcon.strategies.strategy.Strategy[source]

The abstract class Strategy

Every inherited class needs a method plan(), which will be called in every polling cycle and will update the built in statemachine.

Every state of the statemachine consist of a behaviourgroup. The method plan() will set, depending on the status of the the different behaviourgroups, those behaviourgroup as active.

Attributes

lst_behgrps

Methods

__init__()

activate_exclusive(behgrp)

activate given behaviour group (need to be added before to strategy)

add_behgrp(behgrp)

add behaviour sroup to strategy

is_finished()

Returns if stratgy in finish-state

plan()

This method is called in every polling cycle.

set_node(beh_node)

Sets the active BehConNode, where it has been added to.

Details

__init__()[source]
activate_exclusive(behgrp)[source]

activate given behaviour group (need to be added before to strategy)

Parameters

behgrp (BehaviourGroup) – behaviour group

add_behgrp(behgrp)[source]

add behaviour sroup to strategy

Parameters

behgrp (BehaviourGroup) – behaviour group

is_finished()[source]

Returns if stratgy in finish-state

Returns

True if statemachine is in finish-state, else False

abstract plan()[source]

This method is called in every polling cycle.

Needs to be implemented by child-class to update statemachine.

set_node(beh_node)[source]

Sets the active BehConNode, where it has been added to.

Parameters

beh_node – node of type BehConNode

Returns

returns nothing