nopasaran.machines.action_queue.ActionQueue

class nopasaran.machines.action_queue.ActionQueue

Bases: object

Queue for managing actions during state transitions.

This queue is responsible for storing and managing actions to be executed during state transitions.

__init__()

Initialize the ActionQueue.

Methods

__init__()

Initialize the ActionQueue.

add_entry_actions(entry_actions)

Add entry actions to the queue.

add_exit_actions(exit_actions)

Add exit actions to the queue.

assign_transition_variables(...)

Assign transition variables and evaluate transition actions.

dequeue_next_action()

Dequeue the next action.

update_state(state_name)

Update the state.

add_entry_actions(entry_actions)

Add entry actions to the queue.

Args:

entry_actions (list): The list of entry actions to add.

add_exit_actions(exit_actions)

Add exit actions to the queue.

Args:

exit_actions (list): The list of exit actions to add.

assign_transition_variables(old_state_variables, transition_actions)

Assign transition variables and evaluate transition actions.

This method assigns the old and new state variables and evaluates the transition actions.

Args:

old_state_variables (dict): The variables from the old state. transition_actions (list): The list of transition actions to evaluate.

dequeue_next_action()

Dequeue the next action.

Returns:

The dequeued action, or None if the queue is empty.

update_state(state_name)

Update the state.

Args:

state_name (str): The name of the new state.