mixins

module mixins. Various mixin classes to use for simplifying code

class mixins.WithHierarchyTable
__init__() None
add_hierarchy(key: str, hierarchy: Hierarchy) None

Add a hierarchy for the given key :param key: The key to attach the Hierarchy :param hierarchy: The hierarchy to attach :return: None

finished() bool

Returns true if the action has exhausted all its transforms :return:

reset_iterators()

Reinitialize the iterators in the table :return:

class mixins.WithQTableMixinBase(table: Optional[QTable] = None)

Base class to impose the concept of Q-table

__init__(table: Optional[QTable] = None)
class mixins.WithQTableMixin(table: Optional[QTable] = None)

Helper class to associate a q_table with an algorithm

__init__(table: Optional[QTable] = None)

Constructor

Parameters

table (The Q-table representing the Q-function) –

class mixins.WithMaxActionMixin(table: Optional[QTable] = None)

The class WithMaxActionMixin.

__init__(table: Optional[QTable] = None)

Constructor

Parameters

table (The Q-table representing the Q-function) –

max_action(state: Any, n_actions: int) int

Return the action index that presents the maximum value at the given state :param state: state index :param n_actions: Total number of actions allowed :return: The action that corresponds to the maximum value

class mixins.WithEstimatorMixin