Source code for ensemble.metaclass.state

"""
States 
==========
This module presents a state implementation that should be generic for state descriptions.
"""

# ============================================================================
# STANDARD  IMPORTS
# ============================================================================

import abc

# ============================================================================
# CLASS AND DEFINITIONS
# ============================================================================


[docs]class AbsState(metaclass=abc.ABCMeta):
[docs] @abc.abstractmethod def next_state(self): """ State to switch on event""" pass
[docs] def __repr__(self): """ Leverages the __str__ method to describe the State. """ return f"{self.__class__.__name__}()"
[docs] def __str__(self): """ Returns the name of the State. """ return self.__class__.__name__