transition#
- class besser.agent.core.transition.transition.Transition(name, source, dest, event, condition)[source]#
Bases:
object
An agent transition from one state (source) to another (destination).
A transition can have an event and/or a condition, and will be triggered when the target event (if any) was received and the condition (if any) is satisfied.
- Parameters:
name (str) – the transition name
source (State) – the source state of the transition (from where it is triggered)
dest (State) – the destination state of the transition (where the agent moves to)
event (Event) – the event that triggers the transition
condition (Condition) – the condition that triggers the transition
- evaluate(session, target_event)[source]#
Evaluate the transition, i.e., check if the transition’s event was received and the transition condition is satisfied.
- is_auto()[source]#
Check if the transition is auto (i.e. no event nor condition linked to it).
- Returns:
true if the transition is auto, false otherwise
- Return type: