mlpy.agents.fsm.StateMachine.add_onupdate¶
-
StateMachine.
add_onupdate
(source, onupdate=None, conditions=None)[source]¶ Add a callback to be called on update.
Parameters: source : str
The state for which the callback will be triggered.
onupdate : callable
The callback function.
conditions : list[callable]
The conditions that must be met in order to execute the callback.
Raises: ValueError
If the source is not a registered state.
Notes
By setting source to *, the callbacks will be called for all states.