Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
flexbe_core.behavior.Behavior Class Reference
Inheritance diagram for flexbe_core.behavior.Behavior:
Inheritance graph

Public Member Functions

def __init__ (self)
def add_behavior (self, behavior_class, behavior_id)
def add_parameter (self, name, default)
def confirm (self)
def create (self)
def execute (self)
def get_contained_behaviors (self)
def get_current_state (self)
def get_locked_state (self)
def preempt (self)
def prepare_for_execution (self, input_data=None)
def prepare_for_switch (self, state)
def set_parameter (self, name, value)
def set_up (self, id, autonomy_level, debug)
def use_behavior (self, behavior_class, behavior_id, default_keys=None, parameters=None)

Public Attributes


Private Member Functions

def _collect_contained (self, obj, path)
def _get_state_machine (self)
def _get_states_of_path (self, path, container)
def _set_typed_attribute (self, name, value)

Private Attributes


Detailed Description

This is the superclass for all implemented behaviors.

Definition at line 6 of file

Constructor & Destructor Documentation

def flexbe_core.behavior.Behavior.__init__ (   self)
Please call this superclass constructor first when overriding it with your behavior.

Definition at line 11 of file

Member Function Documentation

def flexbe_core.behavior.Behavior._collect_contained (   self,

Definition at line 211 of file

def flexbe_core.behavior.Behavior._get_state_machine (   self)

Definition at line 206 of file

def flexbe_core.behavior.Behavior._get_states_of_path (   self,

Definition at line 242 of file

def flexbe_core.behavior.Behavior._set_typed_attribute (   self,

Definition at line 222 of file

def flexbe_core.behavior.Behavior.add_behavior (   self,
Adds another behavior as part of this behavior.
This other behavior should be declared as contained in the behavior manifest.

@type behavior_class: class
@param behavior_class: The class implementing the other behavior.

@type behavior_id: string
@param behavior_id: Unique identifier for this behavior instance.

Definition at line 54 of file

def flexbe_core.behavior.Behavior.add_parameter (   self,
Adds a parameter to this behavior.
The parameter should be declared in the behavior manifest.

@type name: string
@param name: The name of the parameter.

@type default: object
@param default: The default value of this parameter. Be sure to set it to the right type.

Definition at line 41 of file

def flexbe_core.behavior.Behavior.confirm (   self)
Confirms that this behavior is ready for execution.

Definition at line 150 of file

def flexbe_core.behavior.Behavior.create (   self)
Should create the state machine for this behavior and return it.
It is called immediately before executing the behavior,
so used parameters will have their final value when called.

@return The complete state machine for this behavior.

Definition at line 29 of file

def flexbe_core.behavior.Behavior.execute (   self)
Called when the behavior is executed.
Need to call self.execute_behavior when ready to start the state machine and return its result.

@return: A string containing the execution result such as finished or failed.

Definition at line 158 of file

def flexbe_core.behavior.Behavior.get_contained_behaviors (   self)

Definition at line 219 of file

def flexbe_core.behavior.Behavior.get_current_state (   self)

Definition at line 189 of file

def flexbe_core.behavior.Behavior.get_locked_state (   self)

Definition at line 192 of file

def flexbe_core.behavior.Behavior.preempt (   self)

Definition at line 201 of file

def flexbe_core.behavior.Behavior.prepare_for_execution (   self,
  input_data = None 
Prepares this behavior for execution by building its state machine.

Definition at line 109 of file

def flexbe_core.behavior.Behavior.prepare_for_switch (   self,
Prepares the behavior for being executed after a behavior switch.

@type name: string
@param name: The name of this behavior.

Definition at line 169 of file

def flexbe_core.behavior.Behavior.set_parameter (   self,
Set the given parameter of this behavior or any sub-behavior.
Use a path specification to refer to the corresponding sub-behavior.
The parameter value is propagated to all sub-behaviors according to the propagation rules.
Also, the value is casted to the type of the parameter if required.

@type name: string
@param name: Name of the parameter, possibly including the path to a sub-behavior.

@type value: object
@param value: New value of the parameter of same type as before (or can be casted to that type).

@return: Whether the parameter existed and could be set.

Definition at line 123 of file

def flexbe_core.behavior.Behavior.set_up (   self,

Definition at line 237 of file

def flexbe_core.behavior.Behavior.use_behavior (   self,
  default_keys = None,
  parameters = None 
Creates a state machine implementing the given behavior to use it in the behavior state machine.
Behavior has to be added first.

@type behavior_class: class
@param behavior_class: The class implementing the other behavior.

@type behavior_id: string
@param behavior_id: Same identifier as used for adding.

@type default_keys: list
@param default_keys: List of input keys of the behavior which should be ignored
             and instead use the default values as given by the behavior.

@type parameters: dict
@param parameters: Optional assignment of values to behavior parameters.
           Any assigned parameter will be ignored for runtime customization,
           i.e., cannot be overwritten by a user who runs the behavior.

Definition at line 70 of file

Member Data Documentation


Definition at line 22 of file


Definition at line 20 of file


Definition at line 23 of file


Definition at line 15 of file


Definition at line 19 of file

Definition at line 17 of file

Definition at line 16 of file


Definition at line 25 of file

The documentation for this class was generated from the following file:

Author(s): Philipp Schillinger
autogenerated on Sun Dec 13 2020 04:01:39