|
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) |
|
This is the superclass for all implemented behaviors.
Definition at line 6 of file behavior.py.
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 behavior.py.
def flexbe_core.behavior.Behavior._collect_contained |
( |
|
self, |
|
|
|
obj, |
|
|
|
path |
|
) |
| |
|
private |
def flexbe_core.behavior.Behavior._get_state_machine |
( |
|
self | ) |
|
|
private |
def flexbe_core.behavior.Behavior._get_states_of_path |
( |
|
self, |
|
|
|
path, |
|
|
|
container |
|
) |
| |
|
private |
def flexbe_core.behavior.Behavior._set_typed_attribute |
( |
|
self, |
|
|
|
name, |
|
|
|
value |
|
) |
| |
|
private |
def flexbe_core.behavior.Behavior.add_behavior |
( |
|
self, |
|
|
|
behavior_class, |
|
|
|
behavior_id |
|
) |
| |
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 behavior.py.
def flexbe_core.behavior.Behavior.add_parameter |
( |
|
self, |
|
|
|
name, |
|
|
|
default |
|
) |
| |
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 behavior.py.
def flexbe_core.behavior.Behavior.confirm |
( |
|
self | ) |
|
Confirms that this behavior is ready for execution.
Definition at line 150 of file behavior.py.
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 behavior.py.
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 behavior.py.
def flexbe_core.behavior.Behavior.get_contained_behaviors |
( |
|
self | ) |
|
def flexbe_core.behavior.Behavior.get_current_state |
( |
|
self | ) |
|
def flexbe_core.behavior.Behavior.get_locked_state |
( |
|
self | ) |
|
def flexbe_core.behavior.Behavior.preempt |
( |
|
self | ) |
|
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 behavior.py.
def flexbe_core.behavior.Behavior.prepare_for_switch |
( |
|
self, |
|
|
|
state |
|
) |
| |
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 behavior.py.
def flexbe_core.behavior.Behavior.set_parameter |
( |
|
self, |
|
|
|
name, |
|
|
|
value |
|
) |
| |
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 behavior.py.
def flexbe_core.behavior.Behavior.set_up |
( |
|
self, |
|
|
|
id, |
|
|
|
autonomy_level, |
|
|
|
debug |
|
) |
| |
def flexbe_core.behavior.Behavior.use_behavior |
( |
|
self, |
|
|
|
behavior_class, |
|
|
|
behavior_id, |
|
|
|
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 behavior.py.
flexbe_core.behavior.Behavior._autonomy_level |
|
private |
flexbe_core.behavior.Behavior._behaviors |
|
private |
flexbe_core.behavior.Behavior._debug |
|
private |
flexbe_core.behavior.Behavior._state_machine |
|
private |
flexbe_core.behavior.Behavior.contains |
flexbe_core.behavior.Behavior.id |
flexbe_core.behavior.Behavior.name |
flexbe_core.behavior.Behavior.requested_state_path |
The documentation for this class was generated from the following file: