def simulate_until_target_substate_or_max_t(
        _simulate_until_attractor_or_target_substate_or_max_t, initial_state, perturbed_nodes_by_t,
        predecessor_node_lists, truth_tables):

    """
    Perform simulation to figure whether it reaches target substate.
    Does not return states of simulations that don't reach target substate.

    Target substate is not considered as reached until all the
    perturbations are carried out. Initial state can be considered as
    reached target substate if no perturbations are present.

    :param _simulate_until_attractor_or_target_substate_or_max_t: [function] to perform simulation
    :param initial_state: initial state of the network
    :param perturbed_nodes_by_t: dict (by time steps) of dicts (by nodes) of node states
    :param predecessor_node_lists: list of predecessor node lists
    :param truth_tables: list of dicts (key: tuple of predecessor node states, value: resulting node state)
    :return: list of states where last state contains target substate,
        or None if target substate was not reached
    """

    states, *_, target_substate_is_reached, _ = _simulate_until_attractor_or_target_substate_or_max_t(
        initial_state, perturbed_nodes_by_t, predecessor_node_lists, truth_tables)

    return states if target_substate_is_reached else None