'Check if this engine can be used for execution on the current state. A callback `check_failure` is called upon
failed checks. Note that the execution can still fail even if check() returns True.
You should only override this method in a subclass in order to provide the correct method signature and
docstring. You should override the ``_check`` method to do your actual execution.
:param SimState state: The state with which to execute.
:param args:                   Positional arguments that will be passed to process().
:param kwargs:                 Keyword arguments that will be passed to process().
:return:                       True if the state can be handled by the current engine, False otherwise.'

def check(self, state, *args, **kwargs):

    r = self._check(state, *args, **kwargs)
    if (not r):
        if (self._check_failed is not None):
            self._check_failed(state, *args, **kwargs)
    return r
